Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

章政 8 years ago
parent
commit
b341df6e76
1 changed files with 4 additions and 4 deletions
  1. 4 4
      UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

+ 4 - 4
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -187,13 +187,13 @@ namespace UAS_MES.Packing
             //更新彩盒重量最大值最小值
             if (isKg)
             {
-                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" + (sum + double.Parse(errorValue.Text))/1000 + "', PR_COLORBOXMINW = '" + (sum - double.Parse(errorValue.Text))/1000 + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
-                OperateResult.AppendText("<<重量设置成功,最大值" + (sum + double.Parse(errorValue.Text))/1000 + "kg,最小值" + (sum - double.Parse(errorValue.Text))/1000 + "kg\n", Color.Green);
+                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" +Math.Round( (sum + double.Parse(errorValue.Text))/1000) + "', PR_COLORBOXMINW = '" +Math.Round( (sum - double.Parse(errorValue.Text))/1000) + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
+                OperateResult.AppendText("<<重量设置成功,最大值" +Math.Round( (sum + double.Parse(errorValue.Text))/1000 )+ "kg,最小值" +Math.Round( (sum - double.Parse(errorValue.Text))/1000 ) + "kg\n", Color.Green);
             }
             else
             {
-                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" + (sum + double.Parse(errorValue.Text)) + "', PR_COLORBOXMINW = '" + (sum - double.Parse(errorValue.Text)) + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
-                OperateResult.AppendText("<<重量设置成功,最大值"+ (sum + double.Parse(errorValue.Text)) + "g,最小值"+ (sum - double.Parse(errorValue.Text)) + "g\n", Color.Green);
+                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" +Math.Round( (sum + double.Parse(errorValue.Text)) ) + "', PR_COLORBOXMINW = '" + Math.Round((sum - double.Parse(errorValue.Text))) + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
+                OperateResult.AppendText("<<重量设置成功,最大值"+ Math.Round( (sum + double.Parse(errorValue.Text)) ) + "g,最小值"+ Math.Round((sum - double.Parse(errorValue.Text))) + "g\n", Color.Green);
             }
             //更新采样记录表
             string serialNum = dh.GetSerialNumberByCaller("ProdWeightSample");