private bool Run_BulkLoader(Worker_BulkLoader Prebuilder, bool Verbose) { try { bool returnValue = Prebuilder.Perform_BulkLoader(Verbose); if (Prebuilder.Aborted) { aborted = true; } return(returnValue); } catch (Exception ee) { return(false); } }
private void Run_BulkLoader( bool Verbose ) { // Create the local log directories if (!Directory.Exists(Engine_ApplicationCache_Gateway.Settings.Local_Log_Directory)) { Console.WriteLine("Creating local log directory: " + Engine_ApplicationCache_Gateway.Settings.Local_Log_Directory); Directory.CreateDirectory(Engine_ApplicationCache_Gateway.Settings.Local_Log_Directory); } // Determine the new log name string log_name = "incoming_" + controllerStarted.Year + "_" + controllerStarted.Month.ToString().PadLeft(2, '0') + "_" + controllerStarted.Day.ToString().PadLeft(2, '0') + ".html"; string local_log_name = Engine_ApplicationCache_Gateway.Settings.Local_Log_Directory + "\\" + log_name; // Create the new log file LogFileXhtml preloader_logger = new LogFileXhtml(local_log_name, "SobekCM Incoming Packages Log", "UFDC_Builder.exe", true); // Step through each database instance foreach (Database_Instance_Configuration dbConfig in Engine_ApplicationCache_Gateway.Settings.Database_Connections) { try { if (!dbConfig.Is_Active) { Console.WriteLine( dbConfig.Name + " is set to INACTIVE"); preloader_logger.AddNonError(dbConfig.Name + " is set to INACTIVE"); } else { SobekCM_Database.Connection_String = dbConfig.Connection_String; Library.Database.SobekCM_Database.Connection_String = dbConfig.Connection_String; Worker_BulkLoader newLoader = new Worker_BulkLoader(preloader_logger, verbose, dbConfig, (instances.Count > 1), logFileDirectory); newLoader.Perform_BulkLoader(Verbose); // Save information about this last run Library.Database.SobekCM_Database.Set_Setting("Builder Version", Engine_ApplicationCache_Gateway.Settings.Current_Builder_Version); Library.Database.SobekCM_Database.Set_Setting("Builder Last Run Finished", DateTime.Now.ToString()); Library.Database.SobekCM_Database.Set_Setting("Builder Last Message", newLoader.Final_Message); } } catch { } } }
private bool Run_BulkLoader(Worker_BulkLoader Prebuilder, bool Verbose) { try { bool returnValue = Prebuilder.Perform_BulkLoader( Verbose ); // Save information about this last run Library.Database.SobekCM_Database.Set_Setting("Builder Version", Engine_ApplicationCache_Gateway.Settings.Current_Builder_Version); Library.Database.SobekCM_Database.Set_Setting("Builder Last Run Finished", DateTime.Now.ToString()); Library.Database.SobekCM_Database.Set_Setting("Builder Last Message", Prebuilder.Final_Message); if (Prebuilder.Aborted) aborted = true; return returnValue; } catch ( Exception ) { return false; } }
private bool Run_BulkLoader(Worker_BulkLoader Prebuilder, bool Verbose) { try { bool returnValue = Prebuilder.Perform_BulkLoader( Verbose ); if (Prebuilder.Aborted) aborted = true; return returnValue; } catch ( Exception ee ) { return false; } }