public static void Search() { string choice, keyword; BugFileManager bug = new BugFileManager(); EnhanceFileManager enhance = new EnhanceFileManager(); TaskFileManager task = new TaskFileManager(); do { Console.WriteLine("What do you want to search for? "); Console.WriteLine("(1) Status"); Console.WriteLine("(2) Priority"); Console.WriteLine("(3) Submitter"); choice = Console.ReadLine(); } while (choice != "1" && choice != "2" && choice != "3"); switch (choice) { case "1": keyword = "Closed"; Console.WriteLine("Search for:"); Console.WriteLine("(1) Open Tickets"); Console.WriteLine("(2) Closed Tickets"); keyword = Console.ReadLine(); if (keyword == "1") { keyword = "Open"; } bug.List("status", keyword); task.List("status", keyword); enhance.List("status", keyword); break; case "2": Console.WriteLine("What priority you want to search for? High, Normal, or Low?"); keyword = Console.ReadLine(); bug.List("priority", keyword); task.List("priority", keyword); enhance.List("priority", keyword); break; case "3": Console.WriteLine("Which submitter you want to search for? "); keyword = Console.ReadLine(); bug.List("submitter", keyword); task.List("submitter", keyword); enhance.List("submitter", keyword); break; } }
public static void Main(string[] args) { Console.WriteLine("Welcome to our Ticket system"); string choice; //main loop do { do { Console.WriteLine("Menu:"); Console.WriteLine("(1) Create a New Ticket"); Console.WriteLine("(2) List Current Tickets"); Console.WriteLine("(3) Search Tickets"); Console.WriteLine("(4) Exit Program"); choice = Console.ReadLine(); } while (choice != "1" && choice != "2" && choice != "3" && choice != "4"); //modify input for defining what type of ticket it is. - done if (choice == "1") { Console.WriteLine("What type of ticket is it"); Console.WriteLine("(b)ug, (e)nhancment, or (t)ask"); choice = Console.ReadLine(); CreateTicket.NewTicket(choice); } if (choice == "2") { BugFileManager bug = new BugFileManager(); EnhanceFileManager enhance = new EnhanceFileManager(); TaskFileManager task = new TaskFileManager(); bug.List("", ""); enhance.List("", ""); task.List("", ""); } if (choice == "3") { SearchTicket.Search(); } } while (choice != "4"); }