Beispiel #1
0
 /// <summary>
 /// 批量添加日志
 /// </summary>
 /// <param name="moduleName">功能模块名称,如 系统管理 >> 系统提醒 </param>
 /// <param name="dataId">操作数据id</param>
 /// <param name="type">日志类型,如新增、删除、登录、修改,请传递汉字</param>
 /// <param name="remark">备注,如果是删除的时候,可以把该删除数据的记录保存在该字段中</param>
 /// <param name="userId">操作人ID</param>
 /// <param name="userDepCode">操作部门代码</param>
 public void AddBatchLog(string moduleName, List <string> dataId, string type, string remark, string userId, string userDepCode)
 {
     try
     {
         string         msg        = string.Empty;
         Sys_LogBLL     bllSys_Log = new Sys_LogBLL();
         List <Sys_Log> list_log   = new List <Sys_Log>();
         foreach (var item in dataId)
         {
             Sys_Log Log = new Sys_Log();
             Log.SysLogID              = Guid.NewGuid().ToString();
             Log.SysLog_OperateUserID  = userId;
             Log.SysLog_OperateDep     = userDepCode;
             Log.SysLog_OperateDate    = DateTime.Now;
             Log.SysLog_TableName      = string.Empty;
             Log.SysLog_OperateFunName = moduleName;
             Log.SysLog_OperateDataID  = item;
             Log.SysLog_OperateType    = type;
             Log.SysLog_Remark         = remark;
             Log.SysLog_Ip             = GetIP();
             list_log.Add(Log);
         }
         bllSys_Log.Add(list_log);
     }
     catch { }
 }
Beispiel #2
0
 /// <summary>
 /// 添加日志
 /// </summary>
 /// <param name="moduleName">功能模块名称,如 系统管理 >> 系统提醒 </param>
 /// <param name="dataId">操作数据id</param>
 /// <param name="type">日志类型,如新增、删除、登录、修改,请传递汉字</param>
 /// <param name="remark">备注,如果是删除的时候,可以把该删除数据的记录保存在该字段中</param>
 /// <param name="userId">操作人ID</param>
 /// <param name="userDepCode">操作部门代码</param>
 public void AddLog(string moduleName, string dataId, string type, string remark, string userId, string userDepCode)
 {
     try
     {
         Sys_Log    Log        = new Sys_Log();
         Sys_LogBLL bllSys_Log = new Sys_LogBLL();
         Log.SysLogID              = Guid.NewGuid().ToString();
         Log.SysLog_OperateUserID  = userId;
         Log.SysLog_OperateDep     = userDepCode;
         Log.SysLog_OperateDate    = DateTime.Now;
         Log.SysLog_TableName      = string.Empty;
         Log.SysLog_OperateFunName = moduleName;
         Log.SysLog_OperateDataID  = dataId;
         Log.SysLog_OperateType    = type;
         Log.SysLog_Remark         = remark;
         Log.SysLog_Ip             = GetIP();
         bllSys_Log.Add(Log);
     }
     catch { }
 }