2023-08-04

This commit is contained in:
2023-08-04 17:06:50 +08:00
parent 70a51ab125
commit 78e8037f08
81 changed files with 8897 additions and 2763 deletions
+31 -1
View File
@@ -73,7 +73,37 @@ namespace BLL
}
}
}
/// <summary>
/// 添加操作日志
/// </summary>
/// <param name="userId"></param>
/// <param name="opLog"></param>
public static void AddLog(string userId, string opLog)
{
//SetOvertime(userId);
Model.SGGLDB db = Funs.DB;
Model.Sys_Log log = new Model.Sys_Log
{
LogId = SQLHelper.GetNewID(typeof(Model.Sys_Log)),
HostName = Dns.GetHostName()
};
IPAddress[] ips = Dns.GetHostAddresses(log.HostName);
if (ips.Length > 0)
{
foreach (IPAddress ip in ips)
{
if (ip.ToString().IndexOf('.') != -1)
{
log.Ip = ip.ToString();
}
}
}
log.OperationTime = DateTime.Now;
log.OperationLog = opLog;
log.UserId = userId;
db.Sys_Log.InsertOnSubmit(log);
db.SubmitChanges();
}
/// <summary>
/// 添加操作日志
/// </summary>