Exemplo n.º 1
0
        public void CustomerDeposit(Customer name)
        {
            // Get the destination account
            Console.Write("\n Select account (1 - to Checkings Account, 2 - to Savings Account): ");
            var selection = Convert.ToInt32(Console.ReadLine());
            var destinationAccount = selection == 1 ? (Account) name.GetCheckingsAccount() : (Account) name.GetSavingsAccount();

            // Get the deposit amount
            Console.Write("\n Enter Amount: ");
            var depositAmount = Convert.ToDouble((Console.ReadLine()));

            // Create a new transaction with the deposit info
            Transaction depositTransaction = new DepositTransaction(destinationAccount, depositAmount);

            // Deposit the money into the account
            depositTransaction.FinalizeTransaction();
            Console.WriteLine("\n\tDeposit Completed");
        }