private void GetInventory(Location location) { List <Stock> inventories = _shopBL.GetInventory(location); bool repeat = true; Console.WriteLine($"\nDisplaying inventory of Store located at {location.City}, {location.State}:"); int i = 0; foreach (Stock stock in inventories) { Console.WriteLine("[" + ++i + "] " + stock.ToString()); } Console.WriteLine("Would you like to start a new order at this store?"); Console.WriteLine("[1] yes"); Console.WriteLine("[2] no"); bool repeat2 = true; do { string input2 = Console.ReadLine(); switch (input2) { case "yes": case "1": Log.Information("Selected start a new order"); repeat2 = false; break; case "no": case "2": repeat2 = false; repeat = false; return; default: Console.WriteLine("invalid input"); break; } } while (repeat2); Order newOrder = new Order(_user, location, 0.0, DateTime.Now); do { Console.WriteLine("Select an item to add to your order. Otherwise type [0] to go back."); string input = Console.ReadLine(); int n; if (int.TryParse(input, out n)) { if (input == "0") { Console.WriteLine("Returning to Locations Menu..."); repeat = false; } else if (n > 0 && n <= inventories.Count) { Log.Information($"Selected {inventories[n - 1].Product.Name}"); newOrder = AddToOrder(inventories[n - 1], newOrder); bool repeat3 = true; do { Console.WriteLine("Would you like to add another item to your order?"); Console.WriteLine("[1] Add more items"); Console.WriteLine("[2] View Order and checkout"); Console.WriteLine("[0] Exit (you will lose your order)"); string input2 = Console.ReadLine(); switch (input2) { case "1": repeat3 = false; break; case "2": Console.WriteLine(); Console.WriteLine(newOrder.ToString()); Console.WriteLine("Would you like to check out and complete your order?"); Console.WriteLine("[1] yes, check out"); Console.WriteLine("[2] no, go back"); bool repeat4 = true; do { string input4 = Console.ReadLine(); switch (input4) { case "1": case "yes": Log.Information("Completed order"); Order addedOrder = _shopBL.AddOrder(newOrder); Console.WriteLine("Order completed!"); repeat = false; repeat3 = false; repeat4 = false; break; case "2": case "no": repeat4 = false; break; default: Console.WriteLine("invalid input"); break; } } while (repeat4); break; case "0": repeat3 = false; repeat = false; break; default: Console.WriteLine("invalid input"); break; } } while (repeat3); } else { Console.WriteLine("invalid input"); } } else { Console.WriteLine("invalid input"); } } while (repeat); }