Esempio n. 1
0
        public decimal Deposit(decimal amount)
        {
            this.amount += amount;

            BankTransaction tran = new BankTransaction(amount);

            transactionQueue.Enqueue(tran);

            return(this.amount);
        }
Esempio n. 2
0
        public bool Withdraw(decimal amount)
        {
            if (amount > this.amount)
            {
                return(false);
            }

            this.amount -= amount;
            BankTransaction tran = new BankTransaction(-amount);

            transactionQueue.Enqueue(tran);

            return(true);
        }