Esempio n. 1
0
    protected void btCreateAccount_Click(object sender, EventArgs e)
    {
        BankAccountCreateRequest createAccountRequest = new BankAccountCreateRequest();

        createAccountRequest.CustomerName = this.txtCustomerRef.Text;

        ApplicationBankAccountService service = new ApplicationBankAccountService();

        service.CreateBankAccount(createAccountRequest);

        ShowAllAccounts();
    }
Esempio n. 2
0
    protected void btnWithdrawal_Click(object sender, EventArgs e)
    {
        ApplicationBankAccountService service = new ApplicationBankAccountService();
        WithdrawalRequest request = new WithdrawalRequest();

        Guid AccId = new Guid(ddlBankAccounts.SelectedValue.ToString());

        request.AccountId = AccId;
        request.Amount = Decimal.Parse(txtAmount.Text);
        service.Withdrawal(request);

        DisplaySelectedAccount();
    }
Esempio n. 3
0
    protected void btnTransfer_Click(object sender, EventArgs e)
    {
        ApplicationBankAccountService service = new ApplicationBankAccountService();

        TransferRequest request = new TransferRequest();
        request.AccountIdFrom = new Guid(ddlBankAccounts.SelectedValue.ToString());
        request.AccountIdTo = new Guid(ddlBankAccountsToTransferTo.SelectedValue.ToString());
        request.Amount = Decimal.Parse(txtAmountToTransfer.Text);

        service.Transfer(request);

        DisplaySelectedAccount();
    }
Esempio n. 4
0
    private void DisplaySelectedAccount()
    {
        if (ddlBankAccounts.SelectedValue != "")
        {
            ApplicationBankAccountService service = new ApplicationBankAccountService();

            FindBankAccountResponse response = service.GetBankAccountBy(new Guid(ddlBankAccounts.SelectedValue.ToString()));

            BankAccountView accView = response.BankAccount;

            this.lblAccountNo.Text = accView.Balance.ToString();
            this.lblBalance.Text = accView.Balance.ToString();
            this.lblCustomerRef.Text = accView.CustomerRef;

            rptTransactions.DataSource = accView.Transactions;

            rptTransactions.DataBind();

            FindAllBankAccountResponse allAccountsResponse = service.GetAllBankAccounts();
            ddlBankAccountsToTransferTo.Items.Clear();

            foreach (BankAccountView acc in allAccountsResponse.BankAccountView)
            {
                if (acc.AccountNo.ToString() != ddlBankAccounts.SelectedValue.ToString())
                {
                    ddlBankAccountsToTransferTo.Items.Add(
                        new ListItem(acc.CustomerRef, acc.AccountNo.ToString()));
                }
            }
        }
    }
Esempio n. 5
0
 private void ShowAllAccounts()
 {
     ddlBankAccounts.Items.Clear();
     FindAllBankAccountResponse response =
     new ApplicationBankAccountService().GetAllBankAccounts();
     ddlBankAccounts.Items.Add(new ListItem("Select An Account", ""));
     foreach (BankAccountView accView in response.BankAccountView)
     {
         ddlBankAccounts.Items.Add(
         new ListItem(accView.CustomerRef, accView.AccountNo.ToString()));
     }
 }