diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 0a44bd5..0c34ba9 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -29,6 +29,7 @@ using formula_manage.ViewModel; using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using static System.Net.Mime.MediaTypeNames; using formula_manage.UserClass; +using System.Drawing; namespace formula_manage { @@ -37,12 +38,15 @@ namespace formula_manage /// public partial class MainWindow : Window { + Font font = new Font("Microsoft YaHei", 20); + + bool quit = false; // DataTable DissolvedataTable = new DataTable(); //建立Dissolve缓存 // DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存 // DataTable MACHINEdataTable = new DataTable(); //建立Machine缓存 DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT缓存 - DataTable RecipedataTable = new DataTable(); //建立Recipe缓存 + // DataTable RecipedataTable = new DataTable(); //建立Recipe缓存 public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径 @@ -64,17 +68,8 @@ namespace formula_manage USER.Text = App.USER_Purview; - RecipedataTable.Columns.Add("DYELOT", typeof(int)); - RecipedataTable.Columns.Add("STEP", typeof(string)); - RecipedataTable.Columns.Add("PRODUCT_CODE", typeof(string)); - RecipedataTable.Columns.Add("CONC", typeof(string)); - RecipedataTable.Columns.Add("SHIFT", typeof(string)); - RecipedataTable.Columns.Add("PRODUCT_NAME", typeof(string)); - RecipedataTable.Columns.Add("TARGET_WT", typeof(float)); - RecipedataTable.Columns.Add("UNIT", typeof(string)); - RecipedataTable.Columns.Add("REMARK", typeof(string)); - RRODUCTdataTable.Columns.Add("ID", typeof(int)); + RRODUCTdataTable.Columns.Add("DYELOT", typeof(int)); RRODUCTdataTable.Columns.Add("STEP", typeof(string)); RRODUCTdataTable.Columns.Add("PRODUCT_CODE", typeof(string)); RRODUCTdataTable.Columns.Add("CONC", typeof(string)); @@ -366,19 +361,26 @@ namespace formula_manage private void save(object sender, RoutedEventArgs e) //保存按钮 { + if(Machine.Text =="") + { + System.Windows.MessageBox.Show("请选择机台", "注意",MessageBoxButton.OK , MessageBoxImage.Question) ; + return; + } + 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) { } else return; + if (result == MessageBoxResult.OK) + { + + } else return; } Procedures_N.Text = "1"; Procedures_P.Text = "1"; - RecipedataTable = RRODUCTdataTable; UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //记录当前单序号 Configini.IniWritevalue("SOFTWARE_SET", " T3", str_Prepose); - } private void Button_NewOrder(object sender, RoutedEventArgs e) //新料单按钮 @@ -386,35 +388,30 @@ namespace formula_manage Number_Event(); } - - private void Button_up(object sender, RoutedEventArgs e) + private void Button_up(object sender, RoutedEventArgs e)//总步加 { int i = int.Parse(Procedures_N.Text); if (i < 999) Procedures_N.Text = (i + 1).ToString(); } - - private void Button_dow(object sender, RoutedEventArgs e) + private void Button_dow(object sender, RoutedEventArgs e)//总步减 { int i = int.Parse(Procedures_N.Text); int P = int.Parse(Procedures_P.Text); if (i > 1) Procedures_N.Text = (i - 1).ToString(); if (P >= i) Procedures_P.Text = Procedures_N.Text; - } - - private void Button_StepUp(object sender, RoutedEventArgs e) + private void Button_StepUp(object sender, RoutedEventArgs e)//步加 { int I = int.Parse(Procedures_N.Text); int P = int.Parse(Procedures_P.Text); if (P < I) Procedures_P.Text = (P + 1).ToString(); } - - private void Button_StepDow(object sender, RoutedEventArgs e) + private void Button_StepDow(object sender, RoutedEventArgs e)//步减 { int P = int.Parse(Procedures_P.Text); if (P > 1) Procedures_P.Text = (P - 1).ToString(); } - + private void Button_Technology(object sender, RoutedEventArgs e) { Deputy.Content = new View.ViewProcess(); //打开工艺选择