|
|
@ -184,16 +184,36 @@ namespace SunlightAggregationManager.UserClass |
|
|
{ |
|
|
{ |
|
|
string s_ = deserialized.GetValue("StartTime").ToString()!; |
|
|
string s_ = deserialized.GetValue("StartTime").ToString()!; |
|
|
string e_ = deserialized.GetValue("EndTime").ToString()!; |
|
|
string e_ = deserialized.GetValue("EndTime").ToString()!; |
|
|
|
|
|
string f_ = deserialized.GetValue("Field").ToString()!; |
|
|
|
|
|
|
|
|
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT * FROM [dbo].[Dyelots] " + |
|
|
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT "+ |
|
|
"WHERE CreationTime>'"+s_+"'and CreationTime<'"+e_+"'"); |
|
|
f_+" FROM [dbo].[Dyelots] " + "WHERE CreationTime>'"+s_+"'and CreationTime<'"+e_+"'"); |
|
|
|
|
|
//格式化返回信息
|
|
|
|
|
|
data_.Add("Query", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable)); |
|
|
|
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
|
|
|
} |
|
|
|
|
|
if (Command == "QueryDyelot")//回复QueryDyelot请求的信息
|
|
|
|
|
|
{ |
|
|
|
|
|
string d_ = deserialized.GetValue("DyelotName").ToString()!; |
|
|
|
|
|
string f_ = deserialized.GetValue("Field").ToString()!; |
|
|
|
|
|
|
|
|
|
|
|
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " + |
|
|
|
|
|
f_ + " FROM [dbo].[Dyelots] " + "WHERE Dyelot LIKE '" + d_ + "%'"); |
|
|
//格式化返回信息
|
|
|
//格式化返回信息
|
|
|
data_.Add("Query", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable)); |
|
|
data_.Add("Query", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable)); |
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
} |
|
|
} |
|
|
if (Command == "QueryDetail")//回复info请求的信息
|
|
|
if (Command == "QueryDetail")//回复info请求的信息
|
|
|
{ |
|
|
{ |
|
|
|
|
|
string d_ = deserialized.GetValue("Dyelot").ToString()!; |
|
|
|
|
|
string r_ = deserialized.GetValue("ReDye").ToString()!; |
|
|
|
|
|
string f_ = deserialized.GetValue("Field").ToString()!; |
|
|
|
|
|
|
|
|
|
|
|
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync("SELECT " + |
|
|
|
|
|
f_ + " FROM [dbo].[DyelotsBulkedRecipe] " + "WHERE Dyelot='" + d_ + "'and ReDye='" + r_ + "'"); |
|
|
|
|
|
//格式化返回信息
|
|
|
|
|
|
data_.Add("QueryDetail", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable)); |
|
|
|
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await service.SendAsync(id, ret); |
|
|
await service.SendAsync(id, ret); |
|
|
|