コード例 #1
0
        public static string Builder()
        {
            //Find movie folder path
            string movieDir = BuildDB.MovieDirPath();

            //Create MovieTable
            Console.WriteLine("\n  Creating MovieMetaDataBase . . . .");
            SQLiteConnection mDBconn = DBCommands.CreateConnection();
            object           mDBcmd  = DBCommands.CreateNewMovieTable(mDBconn);

            Console.WriteLine("\n\n  Database created.  You should now populate it.");
            return(movieDir);
        }
コード例 #2
0
 private static bool AddMovie2Database(ResponseStrings OMDBResponse2, string movieDir)
 {
     //bool confirmed = false;
     //while (!confirmed)
     {
         Console.WriteLine("\n  Add Movie metadata to MovieTable? Y or N ");
         string YorN = Console.ReadKey().Key.ToString().ToUpper();
         if (YorN == "Y")
         {
             DBCommands.InsertOBDMData(DBCommands.CreateConnection(), OMDBResponse2); return(true);
         }                                                                                                          // dynamically update table with omdResponse values
         else
         {
             Console.WriteLine("\n|n  OK, on to next movie . . .\n"); return(false);
         }
     }
 }
コード例 #3
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();
        }