呼叫功能通讯

This commit is contained in:
sc committed 2025-08-24 01:04:06 +08:00
commit f4109ecfe1
3 files changed
+51 -32

No files matched your search

+19 -19
View File
@@ -426,30 +426,30 @@ namespace DyeingComputer.UserClass
{
try
{
DataTable Dyelot_dat;
Dyelot_dat = SerializeConvert.JsonDeserializeFromString<DataTable>(SYSDAT);
Dictionary<string, object> Dyelot_dat;
Dyelot_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
Dictionary<string, object> Product_data = new Dictionary<string, object>();//缓存函数
for (int i=0;i<=Dyelot_dat.Rows.Count;i++)
{
DataRow drEmployee = Dyelot_dat.Rows[i];
Product_data.Add("State", drEmployee.Field<int>("State"));
Product_data.Add("Amount", drEmployee.Field<float>("Amount"));
Product_data.Add("DispenseEndTime", drEmployee.Field<string>("DispenseEndTime"));
SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + drEmployee.Field<string>("Dyelot")
+ "' AND Step ='"+ drEmployee.Field<int>("Step") + "' AND ProductCode='"+
drEmployee.Field<string>("ProductCode") + "'", null);
Product_data.Clear();
MainWindowViewModel.Dyelot_dat = SQLiteHelpers.ExecuteDataSet(
"select * from Dyelot where WorkOrder = '" +
MainWindowViewModel.WorkNumder + "'", null).Tables[0];
int dt = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot='" +
drEmployee.Field<string>("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
if (dt == 0) MainWindowViewModel.CALL_FR = false;
}
Product_data.Add("State", Dyelot_dat.GetValue("State"));
if (Dyelot_dat.GetValue("State").ToString() == "301")
{
Product_data.Add("Amount", Dyelot_dat.GetValue("Amount"));
Product_data.Add("DispenseEndTime", Dyelot_dat.GetValue("DispenseEndTime"));
}
SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + Dyelot_dat.GetValue("Dyelot")
+ "' AND Step ='" + Dyelot_dat.GetValue("Step") + "' AND ProductCode='" +
Dyelot_dat.GetValue("ProductCode") + "'", null);
Product_data.Clear();
MainWindowViewModel.Dyelot_dat = SQLiteHelpers.ExecuteDataSet(
"select * from Dyelot where WorkOrder = '" +
MainWindowViewModel.WorkNumder + "'", null).Tables[0];
int dt = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot='" +
Dyelot_dat.GetValue("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
if (dt == 0) MainWindowViewModel.CALL_FR = false;
SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC828" + SYSKEY + SYSDAT);