Ejemplo n.º 1
0
 /// <summary>
 /// Saves an event / exception to database
 /// </summary>
 /// <param name="ex">Exception</param>
 public void AddEvent(string message)
 {
     var ev = new EventLog
     {
         EventLogTime = DateTime.Now,
         Message = message
     };
     db.Add(ev);
     db.Save();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Saves an event / exception to database
 /// </summary>
 /// <param name="accessCode">Access code</param>
 /// <param name="message">Message</param>
 /// <param name="page">Calling page</param>
 public void AddEvent(string accessCode, string message, string page)
 {
     var ev = new EventLog
     {
         EventLogTime = DateTime.Now,
         AccessCode = accessCode,
         Message = message,
         Page = page
     };
     db.Add(ev);
     db.Save();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Save events / exceptions on this page
 /// </summary>
 private void SaveExceptions(string message, string method)
 {
     using (var db = new PersistedRepository())
     {
         var evlog = new EventLog
         {
             EventLogTime = DateTime.Now,
             Message = message,
             PlayerId = 0,
             AccessCode = LblAccessCode.Text,
             Page = "default",
             PageStep = 0,
             Method = method
         };
         db.Add(evlog);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Remove a event log entry from database
 /// </summary>
 public void Remove(EventLog eventLog)
 {
     db.EventLogs.Remove(eventLog);
     db.SaveChanges();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Add an event log entry to the database
 /// </summary>
 public void Add(EventLog eventLog)
 {
     db.EventLogs.Add(eventLog);
     db.SaveChanges();
 }