sc 2 months ago
parent
commit
0cc877284a
  1. 15
      UserClass/AsyncTcpServer.cs

15
UserClass/AsyncTcpServer.cs

@ -406,16 +406,20 @@ namespace DyeingComputer.UserClass
{
try
{
client.SendAsync("SC827" + "[" + MainWindowViewModel.S01 + "]" +
MainWindowViewModel.Dyelot_dat.ToJsonString());
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
string sql_script = "select * from Dyelot where State = '201' AND WorkOrder = '" +
MainWindowViewModel.WorkNumder + "'";
DataTable dt = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //转换
SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC827" + "[" + MainWindowViewModel.S01 + "]" + dt.ToJsonString());
MainWindowViewModel.TX++;
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
}
catch (Exception ex) { client.SendAsync("SC927" + "[" + MainWindowViewModel.S01 + "]" + ex); }
}
else { client.SendAsync("SC999"); }
}//输送信息指令
}//呼叫领料单
else if (SYSAPI == "SC828")
{
if (SYSKEY == MainWindowViewModel.SYSKEY)
@ -443,8 +447,7 @@ namespace DyeingComputer.UserClass
"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 ='" + drEmployee.Field<int>("State") +
"'", null).Tables[0].Rows.Count;
drEmployee.Field<string>("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
if (dt == 0) MainWindowViewModel.CALL_FR = false;
}
SQLiteHelpers.Close(); //关闭连接

Loading…
Cancel
Save