From d3a177194a35a20b2d5329d88dccd14e97411691 Mon Sep 17 00:00:00 2001 From: wugang <425674808@qq.com> Date: Wed, 31 Jan 2018 14:17:07 +0800 Subject: [PATCH] fixed bug --- CowOutputClient/OperateWindow.xaml.cs | 11 +++++++---- CowOutputClient/app.config | 2 +- WeighBusiness/BL/GoodsWeightFloatBL.cs | 16 ---------------- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/CowOutputClient/OperateWindow.xaml.cs b/CowOutputClient/OperateWindow.xaml.cs index 863d7f6..22ca728 100644 --- a/CowOutputClient/OperateWindow.xaml.cs +++ b/CowOutputClient/OperateWindow.xaml.cs @@ -202,17 +202,18 @@ namespace CowOutputClient } } - private void SetStandardWeight(GoodsWeightFloat_Detail floatData, ProCataGoods detail, decimal? num, WeightInfo weight) + private bool SetStandardWeight(GoodsWeightFloat_Detail floatData, ProCataGoods detail, decimal? num, WeightInfo weight) { if (floatData != null && floatData.StandardWeight != null) { if (!CheckGoodsWeight(detail, num, floatData)) { - return; + return false; } else { weight.Weight = floatData.StandardWeight.Value; } } else { weight.Weight = num.Value; } + return true; } private void ReadWeight(ProCataGoods detail) @@ -255,10 +256,12 @@ namespace CowOutputClient weight.SecondNum = goodsWeight; } } else if (rbSelectedNum.IsChecked == true) { - SetStandardWeight(floatData, detail, num, weight); + if (!SetStandardWeight(floatData, detail, num, weight)) + return; weight.SecondNum = goodsWeight; } else { - SetStandardWeight(floatData, detail, goodsWeight??0, weight); + if (!SetStandardWeight(floatData, detail, goodsWeight??0, weight)) + return; } weight.SubWeight = tare; weight.NetWeight = weight.Weight - (weight.SubWeight??0); diff --git a/CowOutputClient/app.config b/CowOutputClient/app.config index 84e6ee1..f270fb1 100644 --- a/CowOutputClient/app.config +++ b/CowOutputClient/app.config @@ -35,7 +35,7 @@ - + diff --git a/WeighBusiness/BL/GoodsWeightFloatBL.cs b/WeighBusiness/BL/GoodsWeightFloatBL.cs index 863424f..d2b4e1b 100644 --- a/WeighBusiness/BL/GoodsWeightFloatBL.cs +++ b/WeighBusiness/BL/GoodsWeightFloatBL.cs @@ -199,22 +199,6 @@ namespace WeighBusiness.BL } return errorMessage; } - - public static ProductTeam GetProductTeam(long? employeeId) - { - var table = SqlHelperEx.DoQuery("select ProductTeam_ID,Name,ProduceType from {0} where Employee_ID = {1}".FormatWith(TableNames.生产班组, employeeId == null ? "null" : employeeId.Value.ToString())); - if (table.Rows.Count > 0) { - foreach (DataRow row in table.Rows) { - var team = new ProductTeam(); - team.ProductTeam_ID = (long)(int.Parse(row[0].ToString())); - team.Name = row[1].ToString(); - team.ProduceType = row[2].ToString(); - return team; - } - } - return null; - } - } }