Ejemplo n.º 1
0
 public ActionResult Update(Bam.Net.Logging.Data.LogEvent dao)
 {
     try
     {
         dao.Save();
         return(Json(new { Success = true, Message = "", Dao = dao.ToJsonSafe() }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
Ejemplo n.º 2
0
        public override void CommitLogEvent(LogEvent logEvent)
        {
            Data.LogEvent logData = new Data.LogEvent();
            logData.Source                = logEvent.Source.First(4000);
            logData.Category              = logEvent.Category.First(4000);
            logData.EventId               = logEvent.EventID;
            logData.User                  = logEvent.User.First(4000);
            logData.Time                  = logEvent.Time;
            logData.MessageSignature      = logEvent.MessageSignature.First(4000);
            logData.MessageVariableValues = logEvent.MessageVariableValues.ToDelimited(v => v, ",").First(4000);
            logData.Message               = logEvent.Message.First(4000);
            logData.Computer              = logEvent.Computer.First(4000);
            logData.Severity              = logEvent.Severity.ToString().First(4000);

            logData.Save(Database);
        }
Ejemplo n.º 3
0
 public ActionResult Delete(long id)
 {
     try
     {
         string msg = "";
         Bam.Net.Logging.Data.LogEvent dao = Bam.Net.Logging.Data.LogEvent.OneWhere(c => c.KeyColumn == id);
         if (dao != null)
         {
             dao.Delete();
         }
         else
         {
             msg = string.Format("The specified id ({0}) was not found in the table (LogEvent)", id);
         }
         return(Json(new { Success = true, Message = msg, Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
Ejemplo n.º 4
0
 public ActionResult Create(Bam.Net.Logging.Data.LogEvent dao)
 {
     return(Update(dao));
 }