private void ProcessChoice(string input) { Console.ForegroundColor = ConsoleColor.White; Account notAccount = new Account(); decimal amount = 0; switch (input) { case "1": DepositWorkflow dep = new DepositWorkflow(); dep.Execute(_currentAccount, amount); break; case "2": WithdrawlWorkflow withdrawl = new WithdrawlWorkflow(); withdrawl.Execute(_currentAccount, "Please enter an amount to withdrawl", false, notAccount); break; case "3": TransferWorkflow transfer = new TransferWorkflow(); transfer.Execute(_currentAccount, amount); break; case "0": DeleteWorkflow delete = new DeleteWorkflow(); delete.Execute(_currentAccount); break; } }
public void Execute(Account account) { Console.ForegroundColor = ConsoleColor.White; Account nullAccount = new Account(); // because I goofed with all of my parameters earlier and need to pass in a blank Console.Clear(); string input = UserPrompts.GetStringFromUser( $"Are you sure you would like to delete {account.Name}'s account?\n(Yes) - (N)o").ToUpper(); if (input.Substring(0, 1) == "Y" || input == "YES") { WithdrawlWorkflow wd = new WithdrawlWorkflow(); wd.Execute(account, "The balance is being drained and returned.", false, nullAccount, true); //Delete the account AccountManager manager = new AccountManager(); manager.DeleteAccount(account); } else { Console.WriteLine("Account was not deleted."); } }
public void Execute(Account currentAccount, decimal amount) { Console.Clear(); DisplayHeading(); int transferAccountNumber = UserPrompts.GetIntFromUser("Please enter the account number you would like to transfer to."); var transferAccount = new AccountManager(); var transferToAccount = transferAccount.GetAccount(transferAccountNumber); if (transferToAccount.Success) { Account MoveThatMoneyAcct = new Account(); MoveThatMoneyAcct = transferToAccount.Data; WithdrawlWorkflow transferFrom = new WithdrawlWorkflow(); transferFrom.Execute(currentAccount, "Please enter an amount to transfer.", true, MoveThatMoneyAcct); Console.WriteLine($"You successfully transfered money to {MoveThatMoneyAcct.Name}"); } }