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 }); }
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); } }