Example #1
0
        public static void ProcessWithdrawal(string accountNumber, int transactionType)
        {
            int     transactionId = TransactionATMController.CreateTransactionConsole(accountNumber, transactionType);
            decimal amount        = GetWithdrawalAmountFromUser();

            WithdrawalCreateModel newWithdrawal = new WithdrawalCreateModel
            {
                Amount        = amount,
                TransactionID = transactionId
            };

            withdrawalService.CreateWithdrawal(newWithdrawal);

            decimal withdrawal = newWithdrawal.Amount;
            decimal newBalance = accountService.SubtractWithdrawalFromBalance(accountNumber, withdrawal);

            accountService.SaveNewBalanceToDatabase(accountNumber, newBalance);
        }