Esempio n. 1
0
 public TransferTransaction(Account fromAccount, Account toAccount, decimal amount)
     : base(amount)
 {
     this._fromAccount = fromAccount;
     this._toAccount   = toAccount;
     _deposit          = new DepositTransaction(toAccount, amount);
     _withdraw         = new WithdrawTransaction(fromAccount, amount);
 }
Esempio n. 2
0
        static void DoWithdraw(Bank bank)
        {
            var account = FindAccount(bank);

            Console.WriteLine("Enter the amount you would like to withdraw: ");
            if (account == null)
            {
                return;                  //stop continuation of procedure
            }
            decimal x           = Convert.ToDecimal(Console.ReadLine());
            var     transaction = new WithdrawTransaction(account, x);

            bank.ExecuteTransaction(transaction);
            transaction.Print();
            /*transaction.Rollback();*/
        }