sc 1 year ago
parent
commit
86c16ed3e9
  1. 20
      UserClass/AsyncTcpServer.cs

20
UserClass/AsyncTcpServer.cs

@ -204,8 +204,8 @@ namespace DyeingComputer.UserClass
DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据 DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据
dr["ProgramID"] = ProgramID; dr["ProgramID"] = ProgramID;
dr["Program"] = ProgramNAME; dr["Program"] = ProgramNAME;
TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1); TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1);
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count; int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
for (int i = 0; i < a; i++) for (int i = 0; i < a; i++)
{ {
@ -298,10 +298,26 @@ namespace DyeingComputer.UserClass
} }
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接 TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
} }//编辑
else if (dat_821.GetValue("INSTRUCTION").ToString() == "DELETE") else if (dat_821.GetValue("INSTRUCTION").ToString() == "DELETE")
{ {
int d = Convert.ToInt16(dat_821.GetValue("ID"));
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
if (a != d)//如果删除不是最后一行执行
{
TechnologicalProcessView.sql.Tables[0].Rows.RemoveAt(d - 1);
for (int i = 0; i < a; i++)
{
DataRow drt = TechnologicalProcessView.sql.Tables[0].Rows[i];
drt.BeginEdit();
drt["Step"] = i + 1;
drt.EndEdit();
}
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView; //转换显示计划表
}
} }
client.SendAsync("SC821" + SYSKEY + SYSDAT); client.SendAsync("SC821" + SYSKEY + SYSDAT);
} }

Loading…
Cancel
Save