Example #1
0
        public decimal Deposit(decimal amount)
        {
            accBal += amount;
            BankTransaction tran = new BankTransaction(amount);

            tranQueue.Enqueue(tran);
            return(accBal);
        }
Example #2
0
        public bool Withdraw(decimal amount)
        {
            bool sufficientFunds = accBal >= amount;

            if (sufficientFunds)
            {
                accBal -= amount;
                BankTransaction tran = new BankTransaction(-amount);
                tranQueue.Enqueue(tran);
            }
            return(sufficientFunds);
        }