Exemplo n.º 1
0
        private void DisplaySelectedAccount()
        {
            if (ddlBankAccounts.SelectedValue.ToString() != "")
            {
                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()));
                    }
                }
            }
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            IList <BankAccountView> accounts = new List <BankAccountView>();

            accounts.Clear();
            FindAllBankAccountResponse responseAll = _bankService.GetAllBankAccounts();

            accounts = responseAll.BankAccountView;
            return(View(accounts));
        }
        public FindAllBankAccountResponse GetAllBankAccounts()
        {
            FindAllBankAccountResponse FindAllBankAccountResponse = new FindAllBankAccountResponse();
            IList <BankAccountView>    bankAccountViews           = new List <BankAccountView>();

            FindAllBankAccountResponse.BankAccountView = bankAccountViews;
            foreach (BankAccount acc in _bankRepository.FindAll())
            {
                bankAccountViews.Add(_mapper.Map <BankAccountView>(acc));
            }
            return(FindAllBankAccountResponse);
        }