定时任务

This commit is contained in:
2025-12-10 19:02:09 +08:00
parent d097f8d4d4
commit 6726cdfb52
14 changed files with 547 additions and 475 deletions
+19 -17
View File
@@ -7,7 +7,6 @@ namespace BLL
public static class LogService
{
public static Model.CNPCDB db = Funs.DB;
/// <summary>
/// 添加操作日志
@@ -81,28 +80,31 @@ namespace BLL
/// <param name="opLog"></param>
public static void AddLog(string userId, string opLog)
{
//SetOvertime(userId);
Model.Sys_Log log = new Model.Sys_Log
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
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)
//SetOvertime(userId);
Model.Sys_Log log = new Model.Sys_Log
{
if (ip.ToString().IndexOf('.') != -1)
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)
{
log.Ip = ip.ToString();
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();
}
log.OperationTime = DateTime.Now;
log.OperationLog = opLog;
log.UserId = userId;
db.Sys_Log.InsertOnSubmit(log);
db.SubmitChanges();
}
/// <summary>