Merge branch 'master' of http://192.168.0.12:13000/sc/Audit_APP
This commit is contained in:
commit
4ae6df4e79
2 files changed
+12
-12
No files matched your search
@@ -24,8 +24,8 @@ namespace Models
|
||||
if (t == null) return 0;
|
||||
if (String.IsNullOrEmpty(t.ProductCode)) return 0;
|
||||
db.Product.Add(t);
|
||||
int count = db.SaveChanges();
|
||||
return count;
|
||||
int counti = db.SaveChanges();
|
||||
return counti;
|
||||
}
|
||||
|
||||
public List<Product> Select()
|
||||
|
||||
+10
-10
@@ -48,7 +48,7 @@ namespace Audit.View
|
||||
private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
|
||||
{
|
||||
int int_stuff_ProductType = 0;
|
||||
if (this.stuff_ProductType.Text == "染料") int_stuff_ProductType = 0;
|
||||
if (this.stuff_ProductType.Text == "染料") int_stuff_ProductType = 0;//原料类型0。染料,1助剂,2粉体
|
||||
if (this.stuff_ProductType.Text == "助剂") int_stuff_ProductType = 1;
|
||||
if (this.stuff_ProductType.Text == "粉体助剂") int_stuff_ProductType = 2;
|
||||
if (string.IsNullOrEmpty(this.stuff_ProductCode.Text)) System.Windows.MessageBox.Show("ERR.C0101:无效的原料信息");//检查原料代码
|
||||
@@ -72,16 +72,16 @@ namespace Audit.View
|
||||
product.GRAVITY = Double.Parse(this.stuff_GRAVITY.Text);//写入原料比重
|
||||
product.Concentration = Double.Parse(this.stuff_Concentration.Text);//写入原料浓度
|
||||
product.ProductType = int_stuff_ProductType;//写入原料类型
|
||||
var count = new ProductProvider().Insert(product);//实例化并添加数据库信息。
|
||||
if (count == 0)//判断执行是否成功
|
||||
{
|
||||
System.Windows.MessageBox.Show("ERR.C0110-1:添加失败");
|
||||
var count = new ProductProvider().Insert(product);//实例化并添加数据库信息。
|
||||
if (count == 0)//判断执行是否成功
|
||||
{
|
||||
System.Windows.MessageBox.Show("ERR.C0110-1:添加失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("添加完成");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("添加完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Button_Delete(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in new issue
Block a user