Пример #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);
 }
Пример #2
0
        static void DoDeposit(Bank bank)
        {
            var account = FindAccount(bank);

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

            bank.ExecuteTransaction(transaction);
            transaction.Print();
        }