/// <summary> /// 添加日志方法 /// </summary> /// <param name="typeId">日志类型编号</param> /// <param name="logMessge">日志内容</param> /// <param name="billTag">单据标示</param> public static void AddLog(LogType typeId, string logMessge, string billTag, EDRS.Model.XT_ZZJG_RYBM UserInfo, List <EDRS.Model.XT_QX_JSBM> UserRole, HttpRequest req) { try { EDRS.Model.YX_DZJZ_JZRZJL entity = new EDRS.Model.YX_DZJZ_JZRZJL(); EDRS.BLL.YX_DZJZ_JZRZJL rzBll = new EDRS.BLL.YX_DZJZ_JZRZJL(req); entity.CZLX = ((int)typeId).ToString(); if (UserInfo != null) { entity.DWBM = UserInfo.DWBM; entity.DWMC = UserInfo.DWMC; entity.CZRGH = UserInfo.GH; entity.CZR = UserInfo.MC; } if (UserRole != null && UserRole.Count > 0) { entity.BMBM = UserRole[0].BMBM; entity.BMMC = UserRole[0].BMMC; } entity.RZNR = logMessge; entity.CZAJBMSAH = billTag == null ? "" : billTag; rzBll.Add(entity); } catch (Exception) { } }
/// <summary> /// 添加日志方法 /// </summary> /// <param name="typeId">日志类型编号</param> /// <param name="logMessge">日志内容</param> /// <param name="billTag">单据标示</param> public static void AddLogList(LogType typeId, string logMessge, string[] billTag, EDRS.Model.XT_ZZJG_RYBM UserInfo, List <EDRS.Model.XT_QX_JSBM> UserRole, HttpRequest req) { try { List <EDRS.Model.YX_DZJZ_JZRZJL> entityList = new List <EDRS.Model.YX_DZJZ_JZRZJL>(); EDRS.BLL.YX_DZJZ_JZRZJL rzBll = new EDRS.BLL.YX_DZJZ_JZRZJL(req); for (int i = 0; i < billTag.Length; i++) { EDRS.Model.YX_DZJZ_JZRZJL entity = new EDRS.Model.YX_DZJZ_JZRZJL(); entity.CZSJ = DateTime.Now; //代理IP entity.CZIP = req.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(entity.CZIP)) { //真实IP entity.CZIP = req.ServerVariables["REMOTE_ADDR"]; } entity.CZLX = ((int)typeId).ToString(); if (UserInfo != null) { entity.DWBM = UserInfo.DWBM; entity.DWMC = UserInfo.DWMC; entity.CZRGH = UserInfo.GH; entity.CZR = UserInfo.MC; } if (UserRole != null && UserRole.Count > 0) { entity.BMBM = UserRole[0].BMBM; entity.BMMC = UserRole[0].BMMC; } entity.RZNR = logMessge; entity.CZAJBMSAH = billTag[i]; entityList.Add(entity); } rzBll.AddByModelList(entityList); } catch (Exception) { } }