void ViewProducts() { //check if user is signed in? if (!session.IsLoggedIn()) { Console.WriteLine("Something must have gone wrong, returning to first menu..."); currentMenu = Menu.Welcome; return; } if (!session.StoreIsChosen()) { Console.WriteLine("Something must have gone wrong, returning to first menu..."); currentMenu = Menu.Welcome; return; } else { //successfully logged in Console.WriteLine($"\n{session.GetCustomerFname()}, welcome to the {session.GetCurrentStoreName()} store!\n"); CartDisplay(); string makeChoice = ("\nWhat would you like to do?\n"); List <string> options = new List <string>(); options.Add("Exit"); options.Add("Go Back to Main Menu"); options.Add("View Order History"); options.Add("Checkout"); string[] products = session.GetCurrentProductNames().ToArray(); foreach (string product in products) { options.Add($"Add {product} to Cart\n{product} costs ${session.GetProductPrice(product)}"); } int choice = ChooseOptionFromList(intro: makeChoice, options: options.ToArray()); switch (choice) { //if sign-in is successful, move to main menu, otherwise, stay in sign in menu case 0: Environment.Exit(0); break; case 1: currentMenu = Menu.Main; break; case 2: PurchaseHistoryByStore(session.GetCurrentStoreName()); currentMenu = Menu.Main; break; case 3: currentMenu = Menu.Checkout; break; default: //attempt to choose store;if successful, go to products menu if (session.AttemptChooseProduct(products[choice - 4])) { currentMenu = Menu.ProductAmount; } break; } } }