static void Main(string[] args) { //Create a menu and make //calls to ShopHandler for search and sort. shandler = new ShopHandler(); while (isRunning) { SortMenu(); } }
private static void Menu() { char c = 'C'; { while (c != '0') { Console.WriteLine ( "Press 1 to sort by Price \nPress 2 to sort by Name \nPress 3 to sort by Price then Name \nPress 4 to sort by Price, grouped by Category \nPress 5 to search by Name \nPress 6 to search by Price \nPress 7 to search by Price and Name \nPress 8 to search by Price OR Name\nPress 0 to to quit." ); string input = Console.ReadLine(); c = input[0]; switch (c) { case '1': ShopHandler.PriceSort(); Console.WriteLine(); break; case '2': ShopHandler.NameSort(); Console.WriteLine(); break; case '3': ShopHandler.PNameSort(); Console.WriteLine(); break; case '4': ShopHandler.CatPriceSort(); Console.WriteLine(); break; case '5': ShopHandler.NameSearch(); Console.WriteLine(); break; case '6': ShopHandler.PriceSearch(); Console.WriteLine(); break; case '7': ShopHandler.PnNSearch(); Console.WriteLine(); break; case '8': ShopHandler.CatSelectSearch(); Console.WriteLine(); break; case '0': return; } } } }