public void Print() { if (_success == true) //if all successful print the tranfer details and the methods from withdraw and deposit { Utl.lineBreak(); System.Console.WriteLine("The transcation was successful"); Utl.lineBreak(); System.Console.WriteLine("Transferred ${0} from {1} to {2}", _amount, _fromAccount.Name, _toAccount.Name); Utl.lineBreak(); _theWithdraw.Print(); Utl.lineBreak(); _theDeposit.Print(); } else //else print that it was not succesful { Console.WriteLine("Transcation wasn't succesful"); } }
private static void DoDeposit(Bank toBank) // deposit method { decimal input; //used to store the user inputted amount Account toAccount = FindAccount(toBank); if (toAccount == null) { return; } Utl.lineBreak(); Console.WriteLine("Enter how much you would like to deposit?"); input = Convert.ToDecimal(Console.ReadLine()); //store the amount after converting to decimal var deposit = new DepositTransaction(toAccount, input); //create a new deposit object deposit.Execute(); // excute the deposit on the deposit object deposit.Print(); // and print the object //account.Deposit(input); // call the Deposit method pass the amount to be deposited }