예제 #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);
   }
 }
예제 #2
0
  @Override
  protected void webserviceCallSucess(String methodName, String result) {
    // TODO Auto-generated method stub
    if (methodName.equalsIgnoreCase(endStationWebservice.getMethodName())) {
      String data = (String) endStationWebservice.parseWebResult(result);
      if (!TextUtils.isEmpty(data)) {
        refreshSpiner4Data(data);
        saveSpConfig(Constants.CONFIG_KEY.END_STATION, data);
        // InitSpinner(rootView, R.id.sp_04, arrSp4Names, arrSp4Values,
        // "");
        InitAutoCompleteTextView(
            HuoDanColumns.DESTINATION,
            rootView,
            R.id.et_01,
            arrSp4Names,
            arrSp4Values,
            getEditTextValue(R.id.et_01));
        webRequest(
            startStationWebservice.getMethodName(),
            startStationWebservice.getWebParams(),
            startStationWebservice.isPost());
      }

    } else if (methodName.equalsIgnoreCase(startStationWebservice.getMethodName())) {
      String data = (String) startStationWebservice.parseWebResult(result);
      if (!TextUtils.isEmpty(data)) {
        refreshSpiner5Data(data);
        saveSpConfig(Constants.CONFIG_KEY.START_STATION, data);
        // InitSpinner(rootView, R.id.sp_05, arrSp5Names, arrSp5Values,
        // "");
        InitAutoCompleteTextView(
            HuoDanColumns.ORIGIN,
            rootView,
            R.id.et_02,
            arrSp5Names,
            arrSp5Values,
            getEditTextValue(R.id.et_02));
        webRequest(
            customerWebservice.getMethodName(),
            customerWebservice.getWebParams(),
            customerWebservice.isPost());
      }

    } else if (methodName.equalsIgnoreCase(customerWebservice.getMethodName())) {
      String data = (String) customerWebservice.parseWebResult(result);
      if (!TextUtils.isEmpty(data)) {
        refreshSpiner6Data(data);
        // InitSpinner(rootView, R.id.sp_06, arrSp6Names, arrSp6Values,
        // "");
        InitAutoCompleteTextView(
            HuoDanColumns.CONSIGNEE,
            rootView,
            R.id.et_06,
            arrSp6Names,
            arrSp6Values,
            getEditTextValue(R.id.et_06));
        saveSpConfig(Constants.CONFIG_KEY.CUSTOMER, data);
      }
    } else if (methodName.equalsIgnoreCase(mGetByCode.getMethodName())) {
      List<HuoDanEntity> lstData = (List<HuoDanEntity>) mGetByCode.parseWebResult(result);
      // int updateCount = lstData.size();
      if (lstData != null && lstData.size() > 0) {
        entity = lstData.get(0);
        initViews(rootView);
      } else {
        Util.MsgBox(getActivity(), "无此货单");
      }
      // Util.MsgBox(getActivity(), "更新" + updateCount + "条数据");
    }
  }
예제 #3
0
 public void refreshSpData() {
   webRequest(
       endStationWebservice.getMethodName(),
       endStationWebservice.getWebParams(),
       endStationWebservice.isPost());
 }