public void AddCustomerRecursively(Customer c) { CMgr.AddCustomer(c); foreach (Account a in c.Accounts) { AMgr.AddAccount(a); foreach (Transaction t in a.Transactions) { TMgr.AddTransaction(t); } } }
public async Task <IActionResult> Deposit(DepositViewModel viewModel) { viewModel.Customer = await CMgr.GetCustomerAsync(CustomerID); viewModel.Validate(ModelState); if (!ModelState.IsValid) { return(View(viewModel)); } await AMgr.DepositAsync(viewModel.Account, viewModel.Amount, viewModel.Comment); viewModel.OperationStatus = OperationStatus.Successful; viewModel.Clear(); return(View(viewModel)); }
public async Task <IActionResult> StatementsResult(int?page = 1) { int?accountNumber = HttpContext.Session.GetInt32(statementsResultSessionKey); if (accountNumber == null) { return(RedirectToAction("Statements")); } var account = await AMgr.GetAccountAsync(accountNumber.Value); IPagedList <Transaction> transactions = await AMgr.GetPagedTransactionsAsync(accountNumber.Value, page); return(View(new StatementsResultViewModel { Transactions = transactions, Account = account })); }
public Account GetPagedStatementByAccountNumber(int accNo, int page) { Account a = AMgr.GetAccountByAccountNumber(accNo); if (a is null) { throw new KeyNotFoundException( "no account with this account number exists"); } List <Transaction> tHistory = TMgr.GetTransactionsForAccount(accNo, TransactionPageSize, page); a.Transactions = tHistory; return(a); }
public List <Account> GetAccountsForCustomer(int custId) { return(AMgr.GetAccountsForCustomer(custId)); }
public void Transfer(int srcNo, int destNo, decimal amount, string comment) { AMgr.Transfer(srcNo, destNo, amount, comment); }
public void WithDraw(int accNo, decimal amount, string comment) { AMgr.WithDraw(accNo, amount, comment); }
public void Deposit(int accNo, decimal amount, string comment) { AMgr.Deposit(accNo, amount, comment); }
public Account GetAccountByAccountNumber(int accNo) { return(AMgr.GetAccountByAccountNumber(accNo)); }