Пример #1
0
        public decimal Deposit(decimal amount)
        {
            Balance += amount;

            BankTransaction bankTransaction = new BankTransaction(amount);

            Transaction.Enqueue(bankTransaction);
            return(Balance);
        }
Пример #2
0
        public bool Withdraw(decimal amount)
        {
            if (Balance - amount < 0)
            {
                return(false);
            }

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

            Transaction.Enqueue(bankTransaction);

            return(true);
        }