public void AddAlert(IInternalAlert alert)
 {
     try
     {
         string        type          = AlertTypeUtils.ToString(alert.Type);
         string        level         = alert.Level.ToString();
         AlertDocument alertDocument = GetAlertDocument(alert.AlertId);
         if (alertDocument == null)
         {
             AlertDocument alertDocument2 = new AlertDocument();
             alertDocument2.AlertId = alert.AlertId;
             alertDocument2.Type    = type;
             alertDocument2.Level   = level;
             alertDocument          = alertDocument2;
             alerts.Insert(alertDocument);
         }
         else
         {
             alertDocument.Type  = type;
             alertDocument.Level = level;
             alerts.Update(alertDocument);
         }
     }
     catch (CorruptionException ex)
     {
         databaseCorruptionHandler.HandleCorruption(ex);
         throw;
     }
 }
        public IInternalAlert GetAlert(long alertId)
        {
            AlertDocument alertDocument = GetAlertDocument(alertId);

            return(new Alert(alertDocument));
        }
Exemple #3
0
 public Alert(AlertDocument doc)
     : this(doc.Level, doc.Type, doc.AlertId)
 {
 }