コード例 #1
0
        public decimal Deposit(decimal amount)
        {
            balance += amount;

            BankTransaction bankTransaction = new BankTransaction(amount);

            transactionQueue.Enqueue(bankTransaction);
            return(balance);
        }
コード例 #2
0
        public bool Withdraw(decimal amount)
        {
            if (balance - amount < 0)
            {
                return(false);
            }

            balance -= amount;
            BankTransaction bankTransaction = new BankTransaction(-amount);

            transactionQueue.Enqueue(bankTransaction);

            return(true);
        }