|
|
@ -719,58 +719,44 @@ namespace DyeingComputer.UserClass |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
SQLiteHelper SQLiteHelpersLOG = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
// SQLiteHelper SQLiteHelpersLOG = new SQLiteHelper(Environment.CurrentDirectory+"\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
// SQLiteHelpersLOG.Open(); //打开数据库
|
|
|
|
Dictionary<string, object> dat_859; |
|
|
|
dat_859 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT); |
|
|
|
|
|
|
|
if (dat_859.GetValue("INSTRUCTION").ToString() == "SERVER") |
|
|
|
{ |
|
|
|
//SQLiteHelper SQLiteHelpersLOG = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
SQLiteHelpersLOG.Open(); //打开数据库
|
|
|
|
DataTable dt_ = SQLiteHelpersLOG.ExecuteDataSet("select * from SERVER where TIME >"+ |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <"+ |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0]; |
|
|
|
SQLiteHelpersLOG.Close();//关闭数据库
|
|
|
|
|
|
|
|
var dt_ = APILog.LOGSELECT("select * from SERVER where TIME >'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'"); |
|
|
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
|
|
|
|
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
|
} |
|
|
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "OperationLog") |
|
|
|
{ |
|
|
|
//SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
SQLiteHelpersLOG.Open(); //打开数据库
|
|
|
|
DataTable dt_ = SQLiteHelpersLOG.ExecuteDataSet("select * from OperationLog where TIME >" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0]; |
|
|
|
SQLiteHelpersLOG.Close();//关闭数据库
|
|
|
|
|
|
|
|
var dt_ = APILog.LOGSELECT("select * from OperationLog where TIME >'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'"); |
|
|
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
|
|
|
|
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
|
} |
|
|
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "IOLog") |
|
|
|
{ |
|
|
|
//SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
SQLiteHelpersLOG.Open(); //打开数据库
|
|
|
|
DataTable dt_ = SQLiteHelpersLOG.ExecuteDataSet("select * from IOLog where TIME >" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0]; |
|
|
|
SQLiteHelpersLOG.Close();//关闭数据库
|
|
|
|
|
|
|
|
|
|
|
|
var dt_ = APILog.LOGSELECT("select * from IOLog where TIME >'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'"); |
|
|
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
|
|
|
|
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
|
} |
|
|
|
else if (dat_859.GetValue("INSTRUCTION").ToString() == "ERRLog") |
|
|
|
{ |
|
|
|
//SQLiteHelpers = new SQLiteHelper("\\DataBase\\LOG.db"); //数据库连接路径
|
|
|
|
SQLiteHelpersLOG.Open(); //打开数据库
|
|
|
|
DataTable dt_ = SQLiteHelpersLOG.ExecuteDataSet("select * from ERRLog where TIME >" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "TIME <" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss"), null).Tables[0]; |
|
|
|
SQLiteHelpersLOG.Close();//关闭数据库
|
|
|
|
|
|
|
|
var dt_ = APILog.LOGSELECT("select * from ERRLog where TIME >'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_S").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "' and TIME <'" + |
|
|
|
DateTime.Parse(dat_859.GetValue("TIME_E").ToString()).ToString("yyyy/MM/dd HH:mm:ss") + "'"); |
|
|
|
client.SendAsync("SC859" + "[" + MainWindowViewModel.S01 + "]" + dt_.ToJsonString());//缓存信息
|
|
|
|
|
|
|
|
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
|
|
@ -778,7 +764,7 @@ namespace DyeingComputer.UserClass |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
client.SendAsync("SC959" + "[" + MainWindowViewModel.S01 + "]" + ex); |
|
|
|
client.SendAsync("SC959" + "[" + MainWindowViewModel.S01 + "]" + ex.Message); |
|
|
|
} |
|
|
|
} |
|
|
|
else { client.SendAsync("SC999"); } |
|
|
|