public static void LoggedInScreen(string userNameInput, string optionalMessage = "") { try { Console.Clear(); Console.WriteLine(ASCIILogic.LoggedInScreen()); if (optionalMessage != "") { Console.WriteLine(optionalMessage, Environment.NewLine); } Console.WriteLine("Welcome back " + userNameInput + ".", Environment.NewLine); Console.WriteLine("(1. Record Deposit) - (2. Record Withdrawl) - (3. Check Balance) - (4. Transaction History) - (5. Logout) - (6. Send Money)"); var loggedInInput = Console.ReadLine(); HandleLoggedInUserInput(loggedInInput, userNameInput); } catch (Exception ex) { log.Info(ex.Message); LoggedInScreen(userNameInput, "There was a technical problem. Please try your action again later"); } }
public static void DisplayTransactions(string userNameInput) { TransactionLogic transLogic = new TransactionLogic(); var transList = transLogic.GetTransactionList(userNameInput); var transactionTable = ASCIILogic.TransactionTable(transList); LoggedInScreen(userNameInput, transactionTable); }
public static void LoggedOutScreen(string optionalMessage = "") { try { Console.Clear(); Console.WriteLine(ASCIILogic.Computer()); if (optionalMessage != "") { Console.WriteLine(optionalMessage, Environment.NewLine); } Console.WriteLine("Welcome to the worlds greatest banking ledger! Type the number of the action you'd like to take from the list below." + Environment.NewLine); Console.WriteLine("(1. Login) - (2. Create Account)"); var userNameInput = Console.ReadLine(); if (userNameInput == "1") { LoginUser(); return; } if (userNameInput == "2") { RegisterUser(); return; } if (userNameInput == "3") { throw new Exception("Trigger test exception"); } LoggedOutScreen("Please input number indicating which action you'd like to take"); } catch (Exception ex) { log.Info(ex.Message); LoggedOutScreen("There was a technical problem. Please try your action again later"); } }