From eef7b0660551f763a455701fe3d794366ad4a583 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 13 Sep 2018 16:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=89=B9=E9=87=8F=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClientGoodsSet_/ClientGoodsSetEdit.cs | 28 +++++++++++++++++++ .../OfflinRpc/SegmentProductionRpc.cs | 14 +++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs index fa89b91..8fc276c 100644 --- a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs +++ b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs @@ -88,14 +88,42 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.ClientGoodsSet_ } _detailGrid.DataBind(); }; + + hPanel.Add(new SimpleLabel("标准上限")); + var up = hPanel.Add(new DFTextBox() { Width=Unit.Pixel(50)}); + hPanel.Add(new SimpleLabel("标准上限")); + var dw = hPanel.Add(new DFTextBox() { Width = Unit.Pixel(50) }); + hPanel.Add(new TSButton("更新上下限", delegate { + GetFromUI(); + decimal? uValue = null; + decimal? wValue = null; + if (!up.IsEmpty) + uValue = decimal.Parse(up.Text); + if (!dw.IsEmpty) + wValue = decimal.Parse(dw.Text); + foreach (var d in _detailGrid.GetSelectedItems()) + { + var detail = d as ClientGoodsSet_Detail; + if (detail.StandardWeight.HasValue) + { + if (uValue.HasValue) + detail.StandardWeightUp = detail.StandardWeight + uValue; + if (wValue.HasValue ) + detail.StandardWeightLow = detail.StandardWeight - wValue; + } + } + AppToUI(); + })); }; var editor = new DFCollectionEditor(() => Dmo.Details); editor.AllowDeletionFunc = () => CanSave; editor.CanDeleteFunc = detail => CanSave; editor.IsEditableFunc = (field, detail) => CanSave; + editor.CanSelectFunc = (detail) => CanSave; _detailGrid = new DFEditGrid(editor); _detailGrid.DFGridSetEnabled = false; + _detailGrid.MultiSelectionEnabled = CanSave; _detailGrid.Width = Unit.Percentage(100); _detailGrid.Columns.Add(new DFEditGridColumn("Goods_Code")); _detailGrid.Columns.Add(new DFEditGridColumn("Goods_Name")); diff --git a/B3ClientService/OfflinRpc/SegmentProductionRpc.cs b/B3ClientService/OfflinRpc/SegmentProductionRpc.cs index 9c3e21e..44f426f 100644 --- a/B3ClientService/OfflinRpc/SegmentProductionRpc.cs +++ b/B3ClientService/OfflinRpc/SegmentProductionRpc.cs @@ -26,6 +26,11 @@ namespace BWP.B3ClientService.Rpcs { foreach (var item in list) { + if(item.Delete) + { + Delete(session, item.BarCode); + continue; + } var id = Exist(session, item.BarCode); if (id == null) { @@ -43,6 +48,13 @@ namespace BWP.B3ClientService.Rpcs return list.Count; } + static void Delete(IDmoSession session, string barCode) + { + var delete = new DQDeleteDom(typeof(SegmentProductionInfo)); + delete.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode)); + session.ExecuteNonQuery(delete); + } + private static void Update(IDmoSession session, long id, SegmentProductionMin entity, params string[] fields) { var update = new DQUpdateDom(typeof(SegmentProductionInfo)); @@ -106,6 +118,6 @@ namespace BWP.B3ClientService.Rpcs public long? Goods_ID { get; set; } public decimal? Weight { get; set; } public DateTime? InStoreTime { get; set; } - + public bool Delete { get; set; } } }