private void SendReport(string html) { WiseMessage wiseMessage = new WiseMessage(null, "Wise Report", html, "SigmaReport", "Reporte de Medidas", WiseNotificationType.System, WiseNotificationPriority.Info, null); try { _logger.Info(string.Format("Sending Sigma Report notification with message length {0}", html.Length)); WiseNotifierSender.sendWiseMessageToNotifier(wiseMessage); } catch (Exception ex) { Logger.Error(String.Format("Exception sending message with report to notifier"), ex); } }
private void SendNotification(WiseNotificationPriority wiseNotificationPriority, string subject, DateTime execInitDatetime, DateTime execEndDatetime, string executionResume, Stopwatch sw) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("Comienzo de ejecución: {0}\n", execInitDatetime); stringBuilder.AppendFormat("Fin de ejecución: {0}\n", execEndDatetime); stringBuilder.AppendFormat("Tiempo total de ejecución: {0}\n", sw.Elapsed); if (!executionResume.Equals("")) { stringBuilder.AppendFormat("Resumen de warning y errores: {0}\n", executionResume); } stringBuilder.AppendFormat("Número de plantas analizadas: {0}\n", Plants.Count()); stringBuilder.Append("Fuente: SIGMA\n"); stringBuilder.AppendFormat("Periodo de busqueda: {0} - {1}\n", SigmaMeasureFilterBeginningDate.ToShortDateString(), SigmaMeasureFilterEndingDate.ToShortDateString()); WiseMessage wiseMessage = new WiseMessage(null, subject, stringBuilder.ToString(), "Sigma", "Medidas Incorporadas", WiseNotificationType.System, wiseNotificationPriority, null); try { WiseNotifierSender.sendWiseMessageToNotifier(wiseMessage); } catch (Exception ex) { Logger.Error(String.Format("Exception sending message to notifier"), ex); } }