Exemple #1
0
 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"); }
 }
Exemple #2
0
 public void RequestBalance(BankAccount account)
 {
     throw new UnAuthorizedUseException("No verified card in the ATM");
 }
Exemple #3
0
 public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum)
 {
     throw new UnAuthorizedUseException("No verified card in the ATM");
 }
Exemple #4
0
 public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum)
 {
     if (ValidateAccountOwner(sender) && authorized)
         atmState.RequestTransfer(sender, reciever, sum);
 }
Exemple #5
0
 public void RequestBalance(BankAccount account)
 {
     if (ValidateAccountOwner(account) && authorized)
         atmState.RequestBalance(account);
 }
Exemple #6
0
 private bool ValidateAccountOwner(BankAccount sender)
 {
     if (activeCustomer == sender.AccountOwnerId()) { return true; }
     return false;
 }
Exemple #7
0
 public void RequestTransfer(BankAccount sender, BankAccount reciever, int sum)
 {
     sender.Transfer(sum, reciever);
 }
Exemple #8
0
 public void RequestBalance(BankAccount account)
 {
     Console.WriteLine(account.CheckBalance());
 }