Example #1
0
 /// <summary>
 /// 添加系统日志
 /// </summary>
 /// <param name="ef"></param>
 public void SystemLog(TMB_LOG ef)
 {
     if (ef != null)
     {
         this.Insert(ef);
     }
 }
        private static void SystemLog(ExceptionContext filterContext, string ip, string controllerName, string actionName, string msgTemplate)
        {
            CurrentUser user = (CurrentUser)filterContext.HttpContext.Request.RequestContext.HttpContext.Session["CurrentUser"];
            TMB_LOG     log  = new TMB_LOG();

            log.C_IP           = ip;
            log.C_URL          = "/" + controllerName + "/" + actionName;
            log.C_OPER_CONTEXT = msgTemplate;
            log.N_STATUS       = 1;
            log.C_REMARK       = filterContext.Exception.Message;
            log.D_MOD_DT       = DateTime.Now;
            if (user != null)
            {
                log.C_EMP_ID = user.Id;
            }
            else
            {
                log.C_EMP_ID = "-1";
            }
            service.SystemLog(log);
        }