Example #1
0
  /**
   * 建立常用地址
   *
   * @param detailAddress
   * @param id
   */
  private void addressCreate(String detailAddress, long pos) {
    long distractId = websitListData.get((int) pos).getDistractId();
    long customerId = mLocalSharePref.getUserId();

    newAddressInfo = new AddressData();
    newAddressInfo.setAddressDetail(detailAddress);
    newAddressInfo.setDistractId(distractId);
    newAddressInfo.setCustomerId(customerId);
    newAddressInfo.setBranchName(websitListData.get((int) pos).getBranchName());
    BaseCommand addressCreate =
        ClientSession.getInstance()
            .getCmdFactory()
            .getAddressCreate(distractId, detailAddress, customerId); // 网点ID,此处暂时设置为1,为玉桥路网点

    mExecuter.execute(addressCreate, mAddressCreateRespHandler);

    dialogUtils.showProgress();
  }
Example #2
0
  /**
   * 处理服务器返回的地址查询
   *
   * @param rsp 服务返回的地址查询结果信息
   */
  private void onReceiveAddressCreateResponse(BaseResponse rsp) {

    if (!rsp.isOK()) {
      String error = getString(R.string.protocol_error) + "(" + rsp.errno + ")";
      dialogUtils.showToast(error);
    } else {
      AddressCreate.Response addressCreate = (AddressCreate.Response) rsp;
      if (addressCreate.responseType.equals("N")) {
        newAddressInfo.setAddressId(addressCreate.addressId);
        onAddressCreateSuccess();
        dialogUtils.showToast(addressCreate.errorMessage);
      } else {
        dialogUtils.showToast(addressCreate.errorMessage);
      }
    }
  }