Ejemplo n.º 1
0
  @Override
  public void onExpand() {
    super.onExpand();
    if (accountCode == null || accountCode.equals("")) {
      return;
    }
    if (getDepositInfo != null) {
      return;
    }
    ProgressOverlay progressOverlay = new ProgressOverlay(getContext());
    progressOverlay.show(
        "",
        new OnProgressEvent() {

          @Override
          public void onProgress() {

            String postData =
                GetDepositInfoRequestJson.GetDepositInfoReportProtocal(
                    Contants.publicModel, accountCode);
            HttpConnector httpConnector = new HttpConnector();
            String httpResult =
                httpConnector.requestByHttpPost(Contants.mobile_url, postData, getContext());
            getDepositInfo = GetDepositInfoRequestJson.parseGetDepositInfoResponse(httpResult);
            if (getDepositInfo == null || !getDepositInfo.responsePublicModel.isSuccess()) {
              return;
            }

            handler.post(
                new Runnable() {

                  @Override
                  public void run() {

                    setData();
                  }
                });
          }
        });
  }
Ejemplo n.º 2
0
  @Override
  public void onClick(View v) {

    if (v == operatorText) {
      lists.clear();

      lists.add(AvailableOperator.TIM_NAME);
      lists.add(AvailableOperator.VODAFONE_NAME);
      lists.add(AvailableOperator.TISCALI_NAME);
      lists.add(AvailableOperator.WIND_NAME);
      lists.add(AvailableOperator.TRE_NAME);

      alertDialog = DialogManager.createOperatorDialog(this, lists);
      alertDialog.show();
    } else if (v == myCardBtn) {

      // DialogManager.createMessageDialog("transfer success!",

      // getContext()).show();
      if (prepareCard()) {
        DialogManager.createMyCardDialog(this, myCardAccounts).show();

      } else {
        BaseActivity baseActivity = (BaseActivity) getContext();
        baseActivity.displayErrorMessage("No available card");
      }

    } else if (v == vertifyBtn) {
      ProgressOverlay progressOverlay = new ProgressOverlay(getContext());
      progressOverlay.show(
          "verify...",
          new OnProgressEvent() {
            @Override
            public void onProgress() {
              PaymentConfirmLayout paymentConfirmLayout =
                  (PaymentConfirmLayout) expandBarResultListener.getOwener();
              AccountsModel accountsModel = paymentConfirmLayout.generateAccountModel();

              String postData =
                  GetCardsJson.GetCardsReportProtocal(
                      Contants.publicModel,
                      beneficiaryNameEditText.getText().toString(),
                      cardNumberEditText.getText().toString(),
                      accountsModel.getAccountCode());
              HttpConnector httpConnector = new HttpConnector();
              String httpResult =
                  httpConnector.requestByHttpPost(Contants.mobile_url, postData, getContext());
              GetCardsResponseModel getCards = GetCardsJson.parseGetCardResponse(httpResult);
              List<InfoCardsModel> list = getCards.getInfoCardListModel();
              BaseActivity baseActivity = (BaseActivity) getContext();
              if (list != null && list.size() > 0) {
                setCardHash(list.get(0).getCardHash());
                isVerifyCard = true;
                title = list.get(0).getTitle();
                name = list.get(0).getName();
                baseActivity.displayErrorMessage("verify success!");
              } else {
                baseActivity.displayErrorMessage("verify fail!");
              }
            }
          });
    } else if (v == payee) {
      // 这里写 showDialog
      DialogManager.createPayeeDialog(this, getRecipientListModel, currentTypeCode).show();
    } else if (v.getParent() == payees_layout) {
      Object o = v.getTag();
      if (o instanceof CardRecipient) {
        CardRecipient resultBankRecipient = (CardRecipient) o;
        beneficiary = resultBankRecipient.getName();
        beneficiaryNameEditText.setText(resultBankRecipient.getName());
        cardNumberEditText.setText(resultBankRecipient.getCardNumber());
      } else if (o instanceof PhoneRecipient) {
        PhoneRecipient resultBankRecipient = (PhoneRecipient) o;
        beneficiary = resultBankRecipient.getPhoneNumber();
        simTopUpNameEdit.setText(resultBankRecipient.getName());
        phoneNumberEdit.setText(resultBankRecipient.getPhoneNumber());
        String destProvider = DestProvider.getDsstProvider(resultBankRecipient.getProvider());
        operatorText.setText(destProvider);
      } else if (o instanceof BankRecipient) {
        BankRecipient resultBankRecipient = (BankRecipient) o;
        beneficiary = resultBankRecipient.getName();
        iban = resultBankRecipient.getIbanCode();
        bic = resultBankRecipient.getBic();
        bankTransferNameEditText.setText(resultBankRecipient.getName());
        ibanEdtiText.setText(resultBankRecipient.getIbanCode());
      }
      payees_layout.removeAllViews();
    }
  }