public override void DoTimerEvent()
 {
     var dataProvider = new MailingListImportDataProvider();
     var importer = new MailingListImporter(dataProvider);
     string irmDBConnectionString = ConfigurationManager.ConnectionStrings["IrmDBContext"].ConnectionString;
     SqlHelperFactory.SqlHelper.IrmDBConnection = irmDBConnectionString;
     List<HealthSystem> systems = HealthSystem.GetHealthSystemList();
     var activeList = systems.Where(x => (x.Active == true));
     int errorCount = 0;
     foreach (HealthSystem healthSystem in activeList)
     {
         try
         {
             SqlHelperFactory.SqlHelper.ClientDbConnection = healthSystem.DBConnectionString;
             var importedFileList = importer.GetImportedFileList();
             foreach (var importedFile in importedFileList)
             {
                 try
                 {
                     importer.InitilizeImport(importedFile.Key, importedFile.Value, healthSystem.DBConnectionString);
                     importer.ProcessImport();
                 }
                 finally
                 {
                     importer.FinalizeImport();
                 }
             }
         }
         catch (Exception e)
         {
             errorCount++;
             log.ErrorFormat("Error processing for {0}: {1}", healthSystem.Name, e.Message);
         }
     }
 }
 public void SetInProgressFlag(int fileId, MailingListImporter.ProcessType stagingLoaded, MailingListImporter.ProcessStatus processing)
 {
     try
     {
         using (var connection = SqlHelperFactory.SqlHelper.GetClientDBConnection())
         {
             using (var command = new SqlCommand("ETL.spImportFileUpdateStatus", connection))
             {
                 command.CommandType = CommandType.StoredProcedure;
                 command.Parameters.AddWithValue("@ImportedFileStatusID", fileId);
                 command.Parameters.AddWithValue("@ProcessTypeId", stagingLoaded);
                 command.Parameters.AddWithValue("@ProcessStatusId", processing);
                 command.Parameters.AddWithValue("@ProcessedBy", "Mail List Import Service");
                 command.ExecuteReader();
             }
         }
     }
     catch (Exception e)
     {
         log.Error(e.Message);
     }
 }