public void AddFunds(BankAccount account, decimal value) { if (value <= 0) throw new ArgumentException("The amount must be bigger than 0"); account.Balance += value; }
static void ShowSavingsStatement(BankAccount savings) { WriteYellowLine("----------------------------"); WriteYellowLine("| Saving Account Statement |"); WriteYellowLine("----------------------------"); Console.WriteLine("Account Number: {0}", savings.AccountNumber.ToString("##-####-##-#")); Console.WriteLine("Balance: {0:C}", savings.Balance); Console.WriteLine(); }
public void DeductServiceFee(BankAccount account) { account.DeductServiceFee(); }
public void DepositFunds(BankAccount account, decimal value) { _bankAccountService.AddFunds(account, value); }
public void TransferFunds(BankAccount sourceAccount, BankAccount destinationAccount, decimal value) { _bankAccountService.RemoveFunds(sourceAccount, value); _bankAccountService.AddFunds(destinationAccount, value); }