diff --git a/UserClass/AsyncTcpServer.cs b/UserClass/AsyncTcpServer.cs index dbe02c6..f89aea0 100644 --- a/UserClass/AsyncTcpServer.cs +++ b/UserClass/AsyncTcpServer.cs @@ -194,13 +194,13 @@ namespace DyeingComputer.UserClass } else if (dat_821.GetValue("INSTRUCTION").ToString() == "INSERT") { - int d = Convert.ToInt16( dat_821.GetValue("ID")); + int d = Convert.ToInt16(dat_821.GetValue("ID")); TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径 TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库 /**插入行**/ string ProgramID = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString(); string ProgramNAME = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString(); - // TechnologicalProcessView.SQLiteHelpers.Close(); + // TechnologicalProcessView.SQLiteHelpers.Close(); DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据 dr["ProgramID"] = ProgramID; dr["Program"] = ProgramNAME; @@ -230,8 +230,8 @@ namespace DyeingComputer.UserClass drtt["DYELOT"] = MainWindowViewModel.WorkNumder; drtt.EndEdit(); - // var _TechnologicalProcessView = Application.Current.Windows.Cast().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面 - // _TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView; + // var _TechnologicalProcessView = Application.Current.Windows.Cast().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面 + // _TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView; //_TechnologicalProcessView.Grid.SelectedIndex = -1; /**存入信息**/ TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null); @@ -251,8 +251,8 @@ namespace DyeingComputer.UserClass TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入 } TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接 - - client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" +MainWindowViewModel.dt_TP.ToJsonString()); + + client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString()); }//插入 else if (dat_821.GetValue("INSTRUCTION").ToString() == "EDIT") { @@ -321,7 +321,10 @@ namespace DyeingComputer.UserClass client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString()); } - client.SendAsync("SC821" + SYSKEY + SYSDAT); + else + { + client.SendAsync("SC821" + SYSKEY + SYSDAT); + } } catch { client.SendAsync("SC921"); } }