Ejemplo n.º 1
0
        public static void MenuOptions(string menuChoice)
        {
            switch (menuChoice)
            {
            case "A":
                Console.WriteLine("\n\tYou are about to create a new empty MovieMetaData database and erase any existing database." +
                                  "\n\tContinue?    Y or N \n");
                ConsoleKeyInfo readKey;
                bool           check = false;
                do
                {
                    readKey = Console.ReadKey(true);
                    check   = !((readKey.Key == ConsoleKey.Y) || (readKey.Key == ConsoleKey.N));
                } while (check);
                switch (readKey.Key)
                {
                case ConsoleKey.Y: BuildDB.Builder();  break;

                case ConsoleKey.N: AppMainMenu(); break;
                }
                break;

            case "B":
                string movieDir = BuildDB.MovieDirPath();
                BuildDB.CycleThuFolders(movieDir);
                break;

            case "C":
                if (DBCommands.CheckIfDBExists() == true)
                {
                    DBCommands.ViewMovieList();
                }
                else
                {
                    Console.WriteLine("\n\n  Returned to Main Menu.");
                }
                break;

            case "D":
                if (DBCommands.CheckIfDBExists() == true)
                {
                    DBCommands.SearchMovieTable();
                }
                else
                {
                    Console.WriteLine("\n  before searching the database.\n\n  Returned to Main Menu.");
                }
                break;

            case "E":
                if (DBCommands.CheckIfDBExists() == true)
                {
                    DBCommands.UpdateUserComment();
                }
                else
                {
                    Console.WriteLine("\n  before updating comments.\n\n  Returned to Main Menu.");
                }


                break;

            case "X":
                Console.BackgroundColor = ConsoleColor.White;
                Console.WriteLine("\n ");
                Console.Beep();
                DateTime Tthen = DateTime.Now;
                do
                {
                } while (Tthen.AddSeconds(1) > DateTime.Now);
                System.Environment.Exit(0);
                break;

            default:
                Console.WriteLine("\n Invalid response");
                //Console.ForegroundColor = ConsoleColor.DarkBlue;
                break;
            }
            //Console.WriteLine("Key to End");
            //Console.ReadKey();
        }