diff --git a/MainWindow.xaml b/MainWindow.xaml index 3c830a6..0b5e6dc 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -13,7 +13,11 @@ - + + + + + @@ -51,45 +55,44 @@ + Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/> + Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/> - - - + + + - - - - - - - + + + + + + + - + KeyUp="Machine_OnKeyDownd" DropDownClosed="Machine_DropDownClosed" InputMethod.IsInputMethodEnabled="False"/> - - - + + + - + @@ -220,12 +223,12 @@ - - + + - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 3fb8f8e..64caf95 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -225,29 +225,6 @@ namespace formula_manage } } - private void Machine_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //机台回车跳转功能 - { - if (e.Key == Key.Enter) - { - if (Machine.Text == "") - { - System.Windows.MessageBox.Show("请确认机台"); - return; - } - - DataRow[] m = MainWindowViewModel.MACHINEdatatemp.Select("Name ='" + Machine.Text + "'"); //查询判断原料代码是否有效 - if (m.Any()) //检查原料信息 - { - System.Windows.MessageBox.Show("机台不存在"); - Machine.Text = ""; - return; - } - - UserClass.PressKey.PressKeys(Keys.Tab, false); - UserClass.PressKey.PressKeys(Keys.Tab, true); - } - } - string Prepose; //料单前置 string PreposeT; //料单时间 string PreposeS; //料单序列格式 @@ -261,7 +238,7 @@ namespace formula_manage UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); Loginprint = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L2")); //是否立即打印料单 Loginanew = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L3")); //是否立即打印料单 - Machine.IsReadOnly = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L4")); //允许自定义机台 + Machine.IsEditable = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L4")); //允许自定义机台 Prepose = Configini.IniReadvalue("SOFTWARE_SET", "T1"); //自定义料单前缀 PreposeT = Configini.IniReadvalue("SOFTWARE_SET", "T2"); //自定义料单时间 @@ -411,6 +388,30 @@ namespace formula_manage Number_Event(); } + private void Machine_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //机台回车跳转功能 + { + if (e.Key == Key.Enter) + { + if (Machine.Text == "") + { + System.Windows.MessageBox.Show("请确认机台"); + return; + } + + DataRow[] m = MainWindowViewModel.MACHINEdatatemp.Select("Name ='" + Machine.Text + "'"); //查询判断原料代码是否有效 + if (!m.Any()) //检查信息 + { + System.Windows.MessageBox.Show("机台不存在"); + Machine.Text = ""; + return; + } + UserClass.PressKey.PressKeys(Keys.Tab, false); + UserClass.PressKey.PressKeys(Keys.Tab, true); + } + } + private void Machine_DropDownClosed(object sender, EventArgs e)//选择机台事件 + { + } private void Button_up(object sender, RoutedEventArgs e)//总步加 { int i = int.Parse(Procedures_N.Text); @@ -460,11 +461,19 @@ namespace formula_manage string listtotal = c.ToString(); list_Total.Text = listtotal; } + DataRow[] r = MainWindowViewModel.MACHINEdatatemp.Select("Name ='" + Machine.Text + "'"); //查询判断原料代码是否有效 + if (!r.Any()) return; //检查信息 + if (double.Parse(r[0].ItemArray[1].ToString()) < a) + { + System.Windows.MessageBox.Show("超载,确定重量","错误",MessageBoxButton.OK,MessageBoxImage.Error); + list_Weight.Text = "0"; + list_Total.Text = "0"; + return; + } } - private void Proportion(object sender, TextChangedEventArgs e) //浴比输入 { - float a, b, c; + float a, b, c=0; b = float.Parse(list_Proportion.Text); if (list_Weight.Text != "") //判断比例是否有效 { @@ -473,6 +482,15 @@ namespace formula_manage string listtotal = c.ToString(); list_Total.Text = listtotal; } + DataRow[] r = MainWindowViewModel.MACHINEdatatemp.Select("Name ='" + Machine.Text + "'"); //查询判断原料代码是否有效 + if (!r.Any()) return; //检查信息 + if (double.Parse(r[0].ItemArray[2].ToString()) < c) + { + System.Windows.MessageBox.Show("超量,确定浴比及浴量", "错误", MessageBoxButton.OK, MessageBoxImage.Error); + list_Proportion.Text = "0"; + list_Total.Text = "0"; + return; + } } string Code_; @@ -816,9 +834,6 @@ namespace formula_manage } } - private void Machine_DropDownClosed(object sender, EventArgs e)//选择机台事件 - { - DYELOT_ = Number.Text; - } + } } diff --git a/Windows/APP_set.xaml b/Windows/APP_set.xaml index 977c546..b6c544a 100644 --- a/Windows/APP_set.xaml +++ b/Windows/APP_set.xaml @@ -10,7 +10,7 @@ - +