2023-08-04
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user