日志重写
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using JinYuan.Helper;
|
||||
using JinYuan.Models;
|
||||
using JinYuan.VirtualDataLibrary;
|
||||
using PLCCommunication;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -38,20 +39,21 @@ namespace LargeSquareOne
|
||||
this.dgv_Log.Rows[rowCount].Cells[2].Value = info;
|
||||
// 设置最新行为活动行 (当前行)
|
||||
this.dgv_Log.CurrentCell = this.dgv_Log.Rows[this.dgv_Log.Rows.Count - 1].Cells[0];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//存储到数据库
|
||||
CommonMethods.db.AddReturnBool(new SysLog()
|
||||
var model = new SysLog()
|
||||
{
|
||||
InsertTime = CurrentTime,
|
||||
LogType = "系统日志",
|
||||
Note = info,
|
||||
AlarmType = isError ? "错误" : "信息",
|
||||
Operater = CommonMethods.currentAdmin.LoginName
|
||||
});
|
||||
};
|
||||
//存储到数据库
|
||||
var b = CommonMethods.db.AddReturnBool(model);
|
||||
if (!b)
|
||||
{
|
||||
LoggerHelp.WriteError($"数据库记录失败. 表:SysLog,内容:{model.ToJsonString()}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user