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