This commit is contained in:
sc committed 2024-12-02 23:34:36 +08:00
commit 86c16ed3e9
1 file changed
+19 -3
+19 -3
View File
@@ -204,8 +204,8 @@ namespace DyeingComputer.UserClass
DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据
dr["ProgramID"] = ProgramID;
dr["Program"] = ProgramNAME;
TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1);
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
for (int i = 0; i < a; i++)
{
@@ -298,10 +298,26 @@ namespace DyeingComputer.UserClass
}
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
}
}//编辑
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);
}