Exemplo n.º 1
0
 boolean onCheckForConfirm(boolean showError) {
   boolean result = false;
   int msgId = 0;
   if (beneficiary_rg.getVisibility() == View.VISIBLE && mIbanCardManager.selectedPosition < 0) {
     result = true;
   } else if (input_benificiary_content.getVisibility() == View.VISIBLE
       && TextUtils.isEmpty(beneficiary_name_et.getText())) {
     result = true;
     msgId = R.string.beneficiary_name_empty_error;
   } else if (input_benificiary_content.getVisibility() == View.VISIBLE
       && TextUtils.isEmpty(iban_et.getText())) {
     result = true;
     msgId = R.string.card_number_empty;
   } else if (TextUtils.isEmpty(amount_et.getText())) {
     result = true;
     msgId = R.string.amount_empty_error;
   }
   //		else if(TextUtils.isEmpty(description_of_payment_et.getText())){
   //			result=true;
   //			msgId=R.string.description_empty_error;
   //		}
   else if (purpose_currency_liner.getVisibility() == View.VISIBLE
       && TextUtils.isEmpty(purpose_currency_et.getText())) {
     result = true;
     msgId = R.string.purpose_currency_empty_error;
   }
   //		else if(bic_et.getVisibility()==View.VISIBLE&&TextUtils.isEmpty(bic_et.getText())){
   //			result=true;
   //			msgId=R.string.bic_empty_error;
   //		}
   if (msgId > 0 && showError) {
     DialogManager.createMessageDialog(msgId, context).show();
   }
   this.confirmation_btn.setEnabled(!result);
   return result;
 }
Exemplo 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();
    }
  }