This commit is contained in:
sc committed 2022-03-06 19:55:24 +08:00
commit 9b7de37cc8
3 files changed
+19 -20

No files matched your search

+2 -2
View File
@@ -39,14 +39,14 @@ namespace Audit.View
{
if (string.IsNullOrWhiteSpace(query_start) || string.IsNullOrWhiteSpace(query_end))//判断查询时间是否存在
{
MessageBox.Show("SC:无效查询信息");//返回无效信息弹窗
MessageBox.Show("SC:无效查询信息", "错误");//返回无效信息弹窗
}
else
{
int query_TimeCompare = DateTime.Compare(Convert.ToDateTime(query_start), Convert.ToDateTime(query_end)); //比较开始结束时间,小于-1 等于0 大于1
if (query_TimeCompare == 1)//判断查询时间是否有效,等于1无效
{
MessageBox.Show("SC:无效查询时间");//返回无效时间弹窗
MessageBox.Show("SC:无效查询时间", "错误");//返回无效时间弹窗
}
else
{
+14 -15
View File
@@ -52,17 +52,17 @@ namespace Audit.View
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:无效的原料信息");//检查原料代码
if (string.IsNullOrEmpty(this.stuff_ProductCode.Text)) System.Windows.MessageBox.Show("ERR.C0101:无效的原料信息", "错误");//检查原料代码
else
if (string.IsNullOrEmpty(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.IsNullOrEmpty(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:无效的原料信息,比重不可为空");//检查原料比重
if (string.IsNullOrEmpty(this.stuff_GRAVITY.Text)) System.Windows.MessageBox.Show("ERR.C0101-1:无效的原料信息", "错误");//检查原料比重
else
if (float.Parse(this.stuff_GRAVITY.Text) < 0 || float.Parse(this.stuff_GRAVITY.Text) > 5) System.Windows.MessageBox.Show("ERR.C0102-1:原料信息错误,比重错误");//检查比重输入数值
if (float.Parse(this.stuff_GRAVITY.Text) < 0 || float.Parse(this.stuff_GRAVITY.Text) > 5) System.Windows.MessageBox.Show("ERR.C0102-1:原料信息错误", "错误");//检查比重输入数值
else
if(float.Parse(this.stuff_Concentration.Text) < 0 || float.Parse(this.stuff_Concentration.Text) > 100) System.Windows.MessageBox.Show("ERR.C0102-2:原料信息错误,浓度错误");//检查浓度输入数值
if(float.Parse(this.stuff_Concentration.Text) < 0 || float.Parse(this.stuff_Concentration.Text) > 100) System.Windows.MessageBox.Show("ERR.C0102-2:原料信息错误", "错误");//检查浓度输入数值
else
{
if (int_stuff_ProductType == 0)//判断是否为染料,非染料写空
@@ -84,11 +84,11 @@ namespace Audit.View
var count = new ProductProvider().Insert(product);//添加数据库信息。
if (count == 0)//判断执行是否成功
{
System.Windows.MessageBox.Show("ERR.C0110-1:添加失败");
System.Windows.MessageBox.Show("ERR.C0110-1:添加失败","错误");
}
else
{
System.Windows.MessageBox.Show("添加完成");
System.Windows.MessageBox.Show("添加完成");
}
}
}
@@ -96,14 +96,12 @@ namespace Audit.View
private void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
{
product.ProductCode = this.stuff_ProductCode.Text;//原料代码
var count = new ProductProvider().Delete(product);//删除数据库目标信息。
if (count == 0)//判断执行是否成功
string ShowProductName = "是否删除" + this.stuff_ProductName.Text;//获取原料名并拼接提示字符串
MessageBoxResult showProductName = System.Windows.MessageBox.Show(ShowProductName, "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否删除目标原料
if (showProductName == MessageBoxResult.Yes)//判断是否删除原料
{
System.Windows.MessageBox.Show("ERR.C0110-2:删除失败");
}
else
{
System.Windows.MessageBox.Show("删除完成");
var count = new ProductProvider().Delete(product);//删除数据库目标信息。
if (count == 0) System.Windows.MessageBox.Show("ERR.C0110-2:删除失败", "错误");//判断执行是否成功
}
}
@@ -148,6 +146,7 @@ namespace Audit.View
///存储色彩变量
/// </summary>
public static int ColorCode_SQL;
private List<Product> Product;
private void Stuff_Color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//色彩框双击事件
{