diff --git a/View/TechnologicalProcessView.xaml.cs b/View/TechnologicalProcessView.xaml.cs index b043ec4..4c2110f 100644 --- a/View/TechnologicalProcessView.xaml.cs +++ b/View/TechnologicalProcessView.xaml.cs @@ -393,7 +393,8 @@ namespace DyeingComputer.View APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "STEP = " + n, "StepID="+ e.StepID + ";StepName="+ e.StepNAME+";P1="+ e.P1+ ";P2="+ e.P2+";P3="+ e.P3+";P4="+ e.P4+";P5="+ e.P5); - + User_Button = true; + } public static void Dat()//行号刷新 { @@ -439,6 +440,7 @@ namespace DyeingComputer.View SQLiteHelpers.Close(); //关闭连接 APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID); + User_Button = true; } private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入 @@ -453,22 +455,21 @@ namespace DyeingComputer.View SQLiteHelpers.Close(); if (ID != null) { d = Convert.ToInt16(ID); } else { return; } - DataRow dr = sql.Tables[0].NewRow();//添加表数据 + DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据 dr["ProgramID"] = ProgramID; dr["Program"] = ProgramNAME; - sql.Tables[0].Rows.InsertAt(dr, d - 1); + MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1); // ID = null; Dat(); APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID); if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } - if (ID == null) ID = sql.Tables[0].Rows.Count.ToString(); + if (ID == null) ID = MainWindowViewModel.dt_TP.Rows.Count.ToString(); ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0"); viewstop.data = ID; viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked); viewstop.ShowDialog(); - //Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表 } string Numder = null; diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs index 71688c2..8ea44be 100644 --- a/ViewModel/MainWindowViewModel.cs +++ b/ViewModel/MainWindowViewModel.cs @@ -1843,6 +1843,7 @@ namespace DyeingComputer.ViewModel public static object D_view=true; public static object A_view=true; + public static bool User_Button = false; public async void IO_view()//IO显示 { if (ViewID == 5) @@ -1872,8 +1873,9 @@ namespace DyeingComputer.ViewModel } public async void TechnologicalProcess_view()//显示 { - if (ViewID == 1 && !UserButton) + if (ViewID == 1 && (!UserButton|| User_Button)) { + User_Button = false; await Task.Run(() => { try