diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 943ee75..b7e47de 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -30,6 +30,7 @@ using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using static System.Net.Mime.MediaTypeNames; using formula_manage.UserClass; using System.Drawing; +using System.Diagnostics; namespace formula_manage { @@ -78,6 +79,7 @@ namespace formula_manage RRODUCTdataTable.Columns.Add("PRODUCT_NAME", typeof(string)); RRODUCTdataTable.Columns.Add("TARGET_WT", typeof(float)); RRODUCTdataTable.Columns.Add("UNIT", typeof(string)); + RRODUCTdataTable.Columns.Add("Process", typeof(string)); RRODUCTdataTable.Columns.Add("REMARK", typeof(string)); if (USER.Text == "ENGINEER") //工程师允许功能 @@ -399,9 +401,8 @@ namespace formula_manage { System.Windows.MessageBox.Show("请选择机台", "注意",MessageBoxButton.OK , MessageBoxImage.Question) ; return; - } - - if (int.Parse(Procedures_N.Text) > int.Parse(Procedures_P.Text)) + } //机台检查 + if (int.Parse(Procedures_N.Text) > int.Parse(Procedures_P.Text)) //步骤检查 { MessageBoxResult result = System.Windows.MessageBox.Show("当前步骤与总步骤设定不符是否继续", "注意", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel); if (result == MessageBoxResult.OK) @@ -410,6 +411,8 @@ namespace formula_manage } else return; } + // SqlCommand insertcommand = new SqlCommand("INSERT INTO [Dispensing].[dbo].[DYELOTS_RECIPE]([CompanyName],[CompanyCode],[Address],[Owner],[Memo])" +"VALUES(@CompanyName, @CompanyCode,@Address,@Owner,@Memo)", conn_SC); + Procedures_N.Text = "1"; Procedures_P.Text = "1"; @@ -550,11 +553,11 @@ namespace formula_manage if (P == MessageBoxResult.Cancel) { } return; } - else + else { MessageBoxResult P = System.Windows.MessageBox.Show("是否进入下一步", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //提示 if (P == MessageBoxResult.Cancel) return; - + Procedures_P.Text = (int.Parse(Procedures_P.Text) + 1).ToString(); PressKey.PressKeys(Keys.Tab, false); PressKey.PressKeys(Keys.Tab, true); @@ -592,7 +595,7 @@ namespace formula_manage Type_ = "%"; if (double.TryParse(list_Weight.Text, out ang)) { - Weight_ = double.Parse(list_Weight.Text) * double.Parse(Conc_) *10; + Weight_ = double.Parse(list_Weight.Text) * double.Parse(Conc_) * 10; } else { @@ -608,14 +611,14 @@ namespace formula_manage { Weight_ = double.Parse(list_Total.Text) * double.Parse(Conc_) / 100; } - else + else { System.Windows.MessageBox.Show("请先确认重量及浴比"); return; } } - if (grid_row == -1) grid_row = 0; + if (grid_row == -1) grid_row = 0; DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列 row.BeginEdit(); row["PRODUCT_CODE"] = Code_; @@ -638,7 +641,7 @@ namespace formula_manage PressKey.PressKeys(Keys.Tab, false); PressKey.PressKeys(Keys.Tab, true); } - } + } DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid } private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件