Exemplo n.º 1
0
        public decimal Deposit(decimal amount)
        {
            Balance += amount;

            BankTransaction bankTransaction = new BankTransaction(amount);

            Transaction.Enqueue(bankTransaction);
            return(Balance);
        }
Exemplo n.º 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);
        }