/// <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); } }
public ActionResult Add() { Doc_Info info = new Doc_Info(); info.Doc_Code = diInstance.GenerateDocCode(); info.Doc_Creator = SessionConfig.UserId(); info.Doc_CreatorName = SessionConfig.UserName(); info.Doc_DpCode = SessionConfig.DeptCode(); info.Doc_DpName = SessionConfig.DeptName(); info.Doc_Date = DateTime.Now; GetbackUrl(); return(View(info)); }