using Common; using Dao; using System; public class WriteSysLogHelper { public static void WriteSysLog(string userName, int menuid, int refid, string Ramark, string IP) { if (string.IsNullOrEmpty(userName)) throw new ArgumentException("登录超时,请重新登录!"); if (string.IsNullOrEmpty(IP)) throw new ArgumentException("非法登录"); try { using (SysOperationLogDao sysOperationLogDao = new SysOperationLogDao()) sysOperationLogDao.AddLog(userName, menuid, refid, Ramark, IP); } catch (Exception ex) { LogHelper.Error("系统日志写入失败!:" + ex.Message, new object[0]); } } }