public void Transfer(decimal sum, BankAccount reciever) { if(sum <= this.balance) { this.balance = this.balance - sum; reciever.balance = reciever.balance + sum; } else { throw new LimitExceedException("Your account does not have enough money to transfer"); } }
public void RequestBalance(BankAccount account) { throw new UnAuthorizedUseException("No verified card in the ATM"); }
public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum) { throw new UnAuthorizedUseException("No verified card in the ATM"); }
public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum) { if (ValidateAccountOwner(sender) && authorized) atmState.RequestTransfer(sender, reciever, sum); }
public void RequestBalance(BankAccount account) { if (ValidateAccountOwner(account) && authorized) atmState.RequestBalance(account); }
private bool ValidateAccountOwner(BankAccount sender) { if (activeCustomer == sender.AccountOwnerId()) { return true; } return false; }
public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum) { sender.Transfer(sum, reciever); }
public void RequestBalance(BankAccount account) { Console.WriteLine(account.CheckBalance()); }