public decimal Deposit(decimal amount) { balance += amount; BankTransaction bankTransaction = new BankTransaction(amount); transactionQueue.Enqueue(bankTransaction); return(balance); }
public bool Withdraw(decimal amount) { if (balance - amount < 0) { return(false); } balance -= amount; BankTransaction bankTransaction = new BankTransaction(-amount); transactionQueue.Enqueue(bankTransaction); return(true); }