public void MakeDeposite(decimal amount, DateTime date, string note) { if (amount <= 0) { throw new ArgumentOutOfRangeException(nameof(amount), "amount most be in posative"); } var depositeAmount = new Transations(amount, date, note); allTransation.Add(depositeAmount); }
public void MakeWithdraw(decimal amount, DateTime date, string note) { if (amount <= 0) { throw new ArgumentOutOfRangeException(nameof(amount), "amount most be posative"); } if (balance - amount == 0) { throw new InvalidOperationException("not sofficient fond is present in account"); } var newWithDrow = new Transations(-amount, date, note); allTransation.Add(newWithDrow); }