diff --git a/View/StuffView.xaml b/View/StuffView.xaml
index b5a17f2..3cfda42 100644
--- a/View/StuffView.xaml
+++ b/View/StuffView.xaml
@@ -96,9 +96,9 @@
-
+
-
+
diff --git a/View/StuffView.xaml.cs b/View/StuffView.xaml.cs
index 8127487..2c8d064 100644
--- a/View/StuffView.xaml.cs
+++ b/View/StuffView.xaml.cs
@@ -44,14 +44,20 @@ namespace Audit.View
private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
{
- if (string.IsNullOrWhiteSpace(this.stuff_ProductCode.Text)) System.Windows.MessageBox.Show("ERR.C0101-1:无效的原料信息");//检查原料代码
+ if (string.IsNullOrEmpty(this.stuff_ProductCode.Text)) System.Windows.MessageBox.Show("ERR.C0101:无效的原料信息");//检查原料代码
else
- if (string.IsNullOrWhiteSpace(this.stuff_ProductName.Text)) System.Windows.MessageBox.Show("ERR.C0101-2:无效的原料信息");//检查原料名称
+ if (string.IsNullOrEmpty(this.stuff_ProductName.Text)) System.Windows.MessageBox.Show("ERR.C0101-2:无效的原料信息,名称不可为空");//检查原料名称
else
- if (string.IsNullOrWhiteSpace(this.stuff_ProductType.Text)) System.Windows.MessageBox.Show("ERR.C0101-3:无效的原料信息");//检查原料类型
+ if (string.IsNullOrEmpty(this.stuff_ProductType.Text)) System.Windows.MessageBox.Show("ERR.C0101-3:无效的原料信息,类型不可为空");//检查原料类型
+ else
+ if (string.IsNullOrEmpty(this.stuff_GRAVITY.Text)) System.Windows.MessageBox.Show("ERR.C0101-1:无效的原料信息,比重不可为空");//检查原料比重
+ else
+ if (int.Parse(this.stuff_GRAVITY.Text) < 0 || int.Parse(this.stuff_GRAVITY.Text) > 5) System.Windows.MessageBox.Show("ERR.C0102-1:原料信息错误,比重错误");//检查比重输入数值
+ else
+ if(int.Parse(this.stuff_Concentration.Text) < 0 || int.Parse(this.stuff_Concentration.Text) > 10) System.Windows.MessageBox.Show("ERR.C0102-2:原料信息错误,浓度错误");//检查浓度输入数值
else
{
-
+
}
}