Esempio n. 1
0
        static void Main(string[] args)
        {
            var parser = new RedBoxJsonParser();

            parser.Execute();

            var movies = parser.RedboxMovies;

            var writer = new RedBoxDatabaseWriter(parser.RedboxMovies);

            writer.WriteAllMovies();
        }
Esempio n. 2
0
 public void WriteToDataBase(RedBoxDatabaseWriter writer)
 {
     try
     {
         writer.WriteAllMovies();
     }
     catch (MySqlException)
     {
         var errorHandler = new ErrorEmailHandler(new DatabaseConnectionException());
         writer.Connection.Close();
         Environment.Exit(-3);
     }
     catch (DatabaseWritingException ex)
     {
         var errorHandler = new ErrorEmailHandler(ex);
         writer.Connection.Close();
         Environment.Exit(-4);
     }
 }