Example #1
0
 public static void AddTrustFactorLog(TrustFactorLog log)
 {
     lock (trustFactorLogLock)
     {
         trustFactorLogs.Add(log);
     }
 }
Example #2
0
 public TrustFactorLog Add(TrustFactorLog trustFactorLog, int callerId)
 {
     using (UBContext ubc = new UBContext())
     {
         try
         {
             ubc.Add(trustFactorLog);
             ubc.SaveChanges();
             return(trustFactorLog);
         }
         catch (Exception ex)
         {
             Utils.Logging.AddLog(new SystemLog()
             {
                 LoggerName = "Unifiedban",
                 Date       = DateTime.Now,
                 Function   = "Unifiedban.Data.TrustFactorLogService.Add",
                 Level      = SystemLog.Levels.Warn,
                 Message    = ex.Message,
                 UserId     = callerId
             });
             if (ex.InnerException != null)
             {
                 Utils.Logging.AddLog(new SystemLog()
                 {
                     LoggerName = "Unifiedban.Data",
                     Date       = DateTime.Now,
                     Function   = "Unifiedban.Data.TrustFactorLogService.Add",
                     Level      = SystemLog.Levels.Warn,
                     Message    = ex.InnerException.Message,
                     UserId     = callerId
                 });
             }
         }
         return(null);
     }
 }