示例#1
0
 /// <summary>
 /// 写入用户登录日志
 /// </summary>
 public static void LoginLog(string UserName, string Msg)
 {
     try
     {
         Bll_Sys_LoginLog instance = new Bll_Sys_LoginLog();
         Sys_LoginLog     model    = new Sys_LoginLog()
         {
             EL_Date     = DateTime.Now,
             EL_UserCode = UserName,
             EL_UserName = SessionConfig.UserName(),
             EL_IP       = HttpContext.Current.Request.UserHostAddress,
             EL_Mac      = "",
             EL_Company  = SessionConfig.Company(),
             EL_Dept     = SessionConfig.DeptName(),
             EL_Success  = Msg
         };
         instance.Insert(model);
     }
     catch (System.Exception ex)
     {
         PlateLog.WriteInFile(SessionConfig.UserId(), SessionConfig.UserName(),
                              HttpContext.Current.Request.UserHostAddress, HttpContext.Current.Request.Url.ToString(),
                              ex.Message, PlateLog.LogMessageType.Error, ex);
     }
 }
示例#2
0
 /// <summary>
 /// 写入用户登录日志
 /// </summary>
 public static void LoginLog(string UserName , string Msg)
 {
     try
     {
         Bll_Sys_LoginLog instance = new Bll_Sys_LoginLog();
         Sys_LoginLog model = new Sys_LoginLog()
         {
             EL_Date = DateTime.Now,
             EL_UserCode = UserName,
             EL_UserName = SessionConfig.UserName(),
             EL_IP = HttpContext.Current.Request.UserHostAddress,
             EL_Mac = "",
             EL_Company = SessionConfig.Company(),
             EL_Dept = SessionConfig.DeptName(),
             EL_Success = Msg
         };
         instance.Insert(model);
     }
     catch (System.Exception ex)
     {
         PlateLog.WriteInFile(SessionConfig.UserId(), SessionConfig.UserName(),
             HttpContext.Current.Request.UserHostAddress, HttpContext.Current.Request.Url.ToString(),
             ex.Message, PlateLog.LogMessageType.Error, ex);
     }
 }