public static bool HandleSelection(string input) { switch (input) { case "1": NewQueryHandler(); break; case "2": Database.PrintCatalog(); break; case "3": SurlyFileReader.LoadFile(); break; case "4": Database.PrintDatabase(); break; case "5": PrintHelp(); break; case "6": MakeEpic("\n\tCome again soon!"); return(false); default: Console.WriteLine($"\n{input} is not an option. Please enter a valid selection."); return(true); } return(true); }
public static void LoadFile() { var reader = new SurlyFileReader(); Console.Write("Enter the path to the file or press enter for default.(default): "); var path = Console.ReadLine(); if (string.IsNullOrWhiteSpace(path) || path == "default") { path = Constants.Surly3InputFile; } reader.ParseFile(path); }