public bool SendFunds(decimal amount, DateTime date, string note) { var withdrawal = new Transactions(-amount, date, note); AllTransaction.Add(withdrawal); Console.WriteLine("Transfer Successful"); return(true); }
public void ReceiveMoney(decimal amount, DateTime date, string note) { if (amount <= 0) { throw new ArgumentOutOfRangeException(nameof(amount), "Amount of deposit must be positive"); } var deposit = new Transactions(amount, date, note); AllTransaction.Add(deposit); }
public override bool Withdrawal(decimal amount, DateTime date, string note) { if (amount <= 0) { throw new ArgumentOutOfRangeException(nameof(amount), "Amount of withdrawal must be positive"); } if (Balance - amount < 1000) { throw new InvalidOperationException("Not sufficient funds for this withdrawal"); } var withdrawal = new Transactions(-amount, date, note); AllTransaction.Add(withdrawal); return(true); }