///<summary>Updates the text box that is displaying the current status of the Listener Service. Returns the status just in case other logic is needed outside of updating the status box.</summary> private eServiceSignalSeverity FillTextListenerServiceStatus() { eServiceSignalSeverity eServiceStatus = EServiceSignals.GetListenerServiceStatus(); if (eServiceStatus == eServiceSignalSeverity.Critical) { textListenerServiceStatus.BackColor = COLOR_ESERVICE_CRITICAL_BACKGROUND; textListenerServiceStatus.ForeColor = COLOR_ESERVICE_CRITICAL_TEXT; butStartListenerService.Enabled = true; } else if (eServiceStatus == eServiceSignalSeverity.Error) { textListenerServiceStatus.BackColor = COLOR_ESERVICE_ERROR_BACKGROUND; textListenerServiceStatus.ForeColor = COLOR_ESERVICE_ERROR_TEXT; butStartListenerService.Enabled = true; } else { textListenerServiceStatus.BackColor = SystemColors.Control; textListenerServiceStatus.ForeColor = SystemColors.WindowText; butStartListenerService.Enabled = false; } textListenerServiceStatus.Text = eServiceStatus.ToString(); return(eServiceStatus); }
private void butListenerServiceAck_Click(object sender, EventArgs e) { EServiceSignals.ProcessSignalsForSeverity(eServiceSignalSeverity.Error); FillTextListenerServiceStatus(); FillGridListenerService(); MsgBox.Show(this, "Errors successfully acknowledged."); }
private void FillGridListenerService() { //Display some historical information for the last 30 days in this grid about the lifespan of the listener heartbeats. List <EServiceSignal> listESignals = EServiceSignals.GetServiceHistory(eServiceCode.ListenerService, DateTime.Today.AddDays(-30), DateTime.Today); gridListenerServiceStatusHistory.BeginUpdate(); gridListenerServiceStatusHistory.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "DateTime"), 120); gridListenerServiceStatusHistory.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Status"), 90); gridListenerServiceStatusHistory.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Details"), 0); gridListenerServiceStatusHistory.ListGridColumns.Add(col); gridListenerServiceStatusHistory.ListGridRows.Clear(); GridRow row; for (int i = 0; i < listESignals.Count; i++) { row = new GridRow(); row.Cells.Add(listESignals[i].SigDateTime.ToString()); row.Cells.Add(listESignals[i].Severity.ToString()); row.Cells.Add(listESignals[i].Description.ToString()); //Color the row if it is an error that has not been processed. if (listESignals[i].Severity == eServiceSignalSeverity.Error && !listESignals[i].IsProcessed) { row.ColorBackG = COLOR_ESERVICE_ERROR_BACKGROUND; } gridListenerServiceStatusHistory.ListGridRows.Add(row); } gridListenerServiceStatusHistory.EndUpdate(); }
private void butListenerAlertsOff_Click(object sender, EventArgs e) { if (!Security.IsAuthorized(Permissions.SecurityAdmin)) { return; } //Insert a row into the eservicesignal table to indicate to all computers to stop monitoring. EServiceSignal signalDisable = new EServiceSignal(); signalDisable.Description = "Stop Monitoring clicked from setup window."; signalDisable.IsProcessed = true; signalDisable.ReasonCategory = 0; signalDisable.ReasonCode = 0; signalDisable.ServiceCode = (int)eServiceCode.ListenerService; signalDisable.Severity = eServiceSignalSeverity.NotEnabled; signalDisable.Tag = ""; signalDisable.SigDateTime = MiscData.GetNowDateTime(); EServiceSignals.Insert(signalDisable); SecurityLogs.MakeLogEntry(Permissions.SecurityAdmin, 0, "Listener Service monitoring manually stopped via eServices Setup window."); MsgBox.Show(this, "Monitoring shutdown signal sent. This will take up to one minute."); FillGridListenerService(); FillTextListenerServiceStatus(); }