private void ViewLocations() { List <Location> locations = _shopBL.GetAllLocations(); if (locations.Count == 0) { Console.WriteLine("No locations in database. You should add some."); } else { Console.WriteLine("\nStore locations: "); int i = 0; foreach (Location location in locations) { Console.WriteLine("[" + ++i + "] " + location.ToString()); } bool repeat = true; Console.WriteLine("Choose which location's inventory you would like to replenish. Otherwise type [0] to go back."); do { string input = Console.ReadLine(); int n; if (int.TryParse(input, out n)) { if (input == "0") { Console.WriteLine("Returning to Manager Menu..."); repeat = false; } else if (n <= locations.Count) { Log.Information($"Selected location {locations[n - 1].City}, {locations[n - 1].State}"); ReplenishInv(locations[n - 1]); repeat = false; } else { Console.WriteLine("invalid input"); } } else { Console.WriteLine("invalid input"); } } while (repeat); } }