Browse Source

原料代码输入判定

master
sc 2 years ago
parent
commit
be7cfcdcaf
  1. 11
      MainWindow.xaml.cs

11
MainWindow.xaml.cs

@ -653,7 +653,7 @@ namespace formula_manage
if (grid_row == -1) grid_row = 0; if (grid_row == -1) grid_row = 0;
Code_ = curComboBox.Text.TrimEnd(); Code_ = curComboBox.Text.TrimEnd();
if (Code_ == "") if ((Code_ == "") && (grid_row != 0))
{ {
if (Procedures_N.Text == Procedures_P.Text) if (Procedures_N.Text == Procedures_P.Text)
{ {
@ -671,7 +671,6 @@ namespace formula_manage
PressKey.PressKeys(Keys.Tab, false); PressKey.PressKeys(Keys.Tab, false);
PressKey.PressKeys(Keys.Tab, true); PressKey.PressKeys(Keys.Tab, true);
return; return;
} }
} }
@ -764,6 +763,14 @@ namespace formula_manage
System.Windows.Controls.TextBox curTextBox = sender as System.Windows.Controls.TextBox; System.Windows.Controls.TextBox curTextBox = sender as System.Windows.Controls.TextBox;
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行 int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
int ID_ = grid_row + 1;
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_CODE is null and ID = '" + ID_ + "'");//查询判断原料代码是否重复
if (c.Any())
{
System.Windows.MessageBox.Show("先选择原料");
return;
}
if (e.Key == Key.Enter) if (e.Key == Key.Enter)
{ {

Loading…
Cancel
Save