Ejemplo n.º 1
0
 private void ReceiveTransfer(EasyBankAccount fromAccount, float amount)
 {
     this.Balance += amount;
     this.transactionHistory.Add(new TransactionItem()
     {
         Date = DateTime.Now, Description = "Received Transfer From " + fromAccount.ToString(), Amount = amount, Type = TransactionType.TransferIn
     });
 }
Ejemplo n.º 2
0
 public bool TransferTo(EasyBankAccount toAccount, float amount)
 {
     if (amount > this.Balance)
     {
         return(false);
     }
     else
     {
         this.Balance -= amount;
         toAccount.ReceiveTransfer(this, amount);
         this.transactionHistory.Add(new TransactionItem()
         {
             Date = DateTime.Now, Description = "Transfer to " + toAccount.ToString(), Amount = -amount, Type = TransactionType.TransferOut
         });
         return(true);
     }
 }