Exemplo n.º 1
0
 private void initDatas() {
   // TODO Auto-generated method stub
   MApplication app = (MApplication) getActivity().getApplication();
   String endJson = app.getData(Constants.CONFIG_KEY.END_STATION, "");
   String startJson = app.getData(Constants.CONFIG_KEY.START_STATION, "");
   String customerJson = app.getData(Constants.CONFIG_KEY.CUSTOMER, "");
   if (TextUtils.isEmpty(endJson)
       || TextUtils.isEmpty(startJson)
       || TextUtils.isEmpty(customerJson)) {
     webRequest(
         endStationWebservice.getMethodName(),
         endStationWebservice.getWebParams(),
         endStationWebservice.isPost());
   } else {
     refreshSpiner4Data(endJson);
     refreshSpiner5Data(startJson);
     refreshSpiner6Data(customerJson);
   }
 }
Exemplo n.º 2
0
  /**
   * * 提货完成操作
   *
   * @return
   */
  private void goodsPrint(HuoDanEntity entity, int nIndex, int endIndex) {
    if (entity != null) {
      MApplication app = (MApplication) getActivity().getApplication();
      String blDeviceAdress = app.getData(Constants.CONFIG_KEY.BLDevice, "");
      if (!TextUtils.isEmpty(blDeviceAdress)) {
        if (PrintUtil.isPrinterOk(getActivity(), blDeviceAdress)) {
          for (int i = nIndex; i < (endIndex + 1); i++) {
            PrintUtil.PrintOne(getActivity(), blDeviceAdress, entity, i);
          }
        } else {
          // Util.MsgBox(getActivity(), "请确认打印设备状态");
        }
      } else {
        new AlertDialog.Builder(getActivity())
            .setTitle("提示")
            .setMessage("当前打印机未设置,是否现在设置?")
            .setPositiveButton(
                "确定",
                new DialogInterface.OnClickListener() {

                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    Intent intent = new Intent(getActivity(), PrintSettingActivity.class);
                    getActivity().startActivity(intent);
                    // Intent intent = new Intent(getActivity(),
                    // PrintActivity.class);
                    // Bundle data = new Bundle();
                    // data.putSerializable(Constants.KEY.DATA1, entity);
                    // intent.putExtras(data);
                    // getActivity().startActivity(intent);
                  }
                })
            .setNegativeButton("取消", null)
            .create()
            .show();
      }
    } else {
      Util.MsgBox(getActivity(), "数据为空");
    }
  }
Exemplo n.º 3
0
 private void saveSpConfig(String key, String json) {
   MApplication app = (MApplication) getActivity().getApplication();
   app.setData(key, json);
 }