public void LogInfo(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = state + AbstractImportExportSettings.SEPARATOR + message + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { EventLogProvider.LogEvent(EventType.INFORMATION, sourceText, eventCodeText, message, RequestContext.CurrentURL); } }
public void LogWarning(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = state + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { EventLogProvider.LogEvent(EventType.ERROR, sourceText, eventCodeText, message, RequestContext.CurrentURL); } }
public void LogQuit(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = QUIT_SIGN + AbstractImportExportSettings.SEPARATOR + message + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { new EventLogProvider().LogEvent(EventLogProvider.EVENT_TYPE_INFORMATION, DateTime.Now, sourceText, eventCodeText, URLHelper.CurrentURL, message); } }
public void LogError(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = FAILED_SIGN + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { new EventLogProvider().LogEvent(EventLogProvider.EVENT_TYPE_ERROR, DateTime.Now, sourceText, eventCodeText, URLHelper.CurrentURL, message); } }
/// <summary> /// Takes all sites offline. /// </summary> private void TakeSitesOffline() { var sites = SiteInfoProvider.GetSites("(SiteIsOffline IS NULL) OR (SiteIsOffline = 0)", null); var siteIDs = new List <int>(sites.Items.Count); foreach (var site in sites) { site.SiteIsOffline = true; SiteInfoProvider.SetSiteInfo(site); siteIDs.Add(site.SiteID); } PersistentStorageHelper.SetValue("SeparateDBSites", siteIDs); }
/// <summary> /// Stop tasks. /// </summary> void btnStopTasks_Click(object sender, EventArgs e) { // Stop tasks PersistentStorageHelper.SetValue("CMSSchedulerTasksEnabled", SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled")); if (SchedulingHelper.EnableScheduler) { SettingsKeyInfoProvider.SetGlobalValue("CMSSchedulerTasksEnabled", false); } WinServiceHelper.RestartService(WinServiceHelper.HM_SERVICE_BASENAME, false); // Display stopping progress iconHelp.Visible = btnStopTasks.Visible = false; DisplayStoppingTasks(); TasksManuallyStopped = true; }
public void LogQuit(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = QUIT_SIGN + AbstractImportExportSettings.SEPARATOR + message + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { var logData = new EventLogData(EventTypeEnum.Information, sourceText, eventCodeText) { EventDescription = message, EventUrl = RequestContext.CurrentURL }; Service.Resolve <IEventLogService>().LogEvent(logData); } }
public void LogError(string message, string sourceText, string eventCodeText, bool logToEventLog) { string value = FAILED_SIGN + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content; PersistentStorageHelper.SetValue(STORAGE_KEY, value); if (logToEventLog) { var logData = new EventLogData(EventTypeEnum.Error, sourceText, eventCodeText) { EventDescription = message, EventUrl = RequestContext.CurrentURL }; Service.Resolve <IEventLogService>().LogEvent(logData); } }
/// <summary> /// Takes all sites offline. /// </summary> private void TakeSitesOffline() { var sites = SiteInfoProvider.GetSites() .WhereNull("SiteIsOffline") .Or() .WhereEquals("SiteIsOffline", 0) .TypedResult; var siteIDs = new List <int>(sites.Items.Count); foreach (var site in sites) { site.SiteIsOffline = true; SiteInfoProvider.SetSiteInfo(site); siteIDs.Add(site.SiteID); } PersistentStorageHelper.SetValue("SeparateDBSites", siteIDs); }
/// <summary> /// Stop tasks. /// </summary> void btnStopTasks_Click(object sender, EventArgs e) { // Stop tasks PersistentStorageHelper.SetValue("CMSSchedulerTasksEnabled", SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled")); if (SchedulingHelper.EnableScheduler) { SettingsKeyInfoProvider.SetValue("CMSSchedulerTasksEnabled", false); } // Restart win service WinServiceItem def = WinServiceHelper.GetServiceDefinition(WinServiceHelper.HM_SERVICE_BASENAME); if (def != null) { WinServiceHelper.RestartService(def.GetServiceName()); } // Display stopping progress iconHelp.Visible = btnStopTasks.Visible = false; DisplayStoppingTasks(); TasksManuallyStopped = true; }