Exemplo n.º 1
0
        /*
         * // THIS METHOD IS NO LONGER USED AND IS INSTEAD IN THE REBUILD SCRIPT
         *
         * // This method runs all of the procedures in the procedures.txt file.
         * public static void RerunAllProcedures()
         * {
         *  using (StreamReader sr = new StreamReader("..\\..\\config\\procedures.txt"))
         *  {
         *      while (!sr.EndOfStream)
         *      {
         *          string line = sr.ReadLine();
         *          using (StreamReader sr2 = new StreamReader(line))
         *          {
         *              string sql = "";
         *              while (!sr2.EndOfStream)
         *              {
         *                  string ln = sr2.ReadLine();
         *                  if (ln.ToLower() == "go")
         *                  {
         *                      Run(sql, line);
         *                      sql = "";
         *                  }
         *                  else
         *                  {
         *                      sql += ln + ' ';
         *                  }
         *              }
         *              if (sql != "")
         *                  Run(sql, line);
         *          }
         *      }
         *  }
         *
         *  MessageBox.Show("All procedures successfully run");
         * }
         */

        // Add a movie to the database
        public static bool AddMovie(string MovieName, int directorId, int studioId, string date, string rating, int length)
        {
            try
            {
                Call(SqlProcedures.AddMovie(MovieName, directorId, studioId, date, rating, length));
                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(false);
            }
        }