Beispiel #1
0
        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
            }));
        }
Beispiel #2
0
        public async Task <IActionResult> Transfer(TransferViewModel viewModel)
        {
            viewModel.Customer = await CMgr.GetCustomerAsync(CustomerID);

            viewModel.DestAccount = await AMgr.GetAccountAsync(viewModel.DestAccountNumber);

            viewModel.Validate(ModelState);
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            await AMgr.TransferAsync(viewModel.Account, viewModel.DestAccount, viewModel.Amount, viewModel.Comment);

            viewModel.OperationStatus = OperationStatus.Successful;
            viewModel.Clear();
            return(View(viewModel));
        }