private void ViewUsers() { List<Customer> users = _shopBL.GetAllUsers(); if (users.Count == 0) Console.WriteLine("No users in database."); else { Console.WriteLine("Full list of users: "); int i = 0; foreach (Customer user in users) { Console.WriteLine("[" + ++i + "]" + user.ToString()); } bool repeat = true; Console.WriteLine("Choose which account's order history you would like to view. 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 Users Menu..."); repeat = false; } else if(n <= users.Count) { Log.Information($"Selected to view {users[n - 1].Name}'s order history"); ViewOrderHistory(users[n - 1]); repeat = false; } else Console.WriteLine("invalid input"); } else Console.WriteLine("invalid input"); } while (repeat); } }