From 19bd79d8f3b09c1f9905ca88e6f9f4a503d8ea8a Mon Sep 17 00:00:00 2001 From: wugang <425674808@qq.com> Date: Wed, 21 Nov 2018 15:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.141791?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Overlays/SaleOutStoreEdit_Ext.cs | 3 +- B3_QiLianMuGe/B3_QiLianMuGe.csproj | 1 + .../SaleOutStoreDoNullifyDoSomethingIoc.cs | 56 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 B3_QiLianMuGe/TypeIOCs/SaleOutStoreDoNullifyDoSomethingIoc.cs diff --git a/B3_QiLianMuGe.Web/Pages/Overlays/SaleOutStoreEdit_Ext.cs b/B3_QiLianMuGe.Web/Pages/Overlays/SaleOutStoreEdit_Ext.cs index 5152efd..3ed4ba7 100644 --- a/B3_QiLianMuGe.Web/Pages/Overlays/SaleOutStoreEdit_Ext.cs +++ b/B3_QiLianMuGe.Web/Pages/Overlays/SaleOutStoreEdit_Ext.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using BWP.Web.Pages.B3Sale.Bills.SaleOutStore_; using TSingSoft.WebControls2; +using Forks.Utils.Collections; namespace BWP.Web.Pages.Overlays { @@ -11,7 +12,7 @@ namespace BWP.Web.Pages.Overlays { protected override void AddCustomerDetailColumns(DFEditGrid detailGrid) { - detailGrid.Columns.Add(new DFEditGridColumn("PackageNum")); + detailGrid.Columns.EAdd(new DFEditGridColumn("PackageNum")).SumMode = SumMode.Sum; } } } diff --git a/B3_QiLianMuGe/B3_QiLianMuGe.csproj b/B3_QiLianMuGe/B3_QiLianMuGe.csproj index 1f7cc11..bc049db 100644 --- a/B3_QiLianMuGe/B3_QiLianMuGe.csproj +++ b/B3_QiLianMuGe/B3_QiLianMuGe.csproj @@ -134,6 +134,7 @@ + diff --git a/B3_QiLianMuGe/TypeIOCs/SaleOutStoreDoNullifyDoSomethingIoc.cs b/B3_QiLianMuGe/TypeIOCs/SaleOutStoreDoNullifyDoSomethingIoc.cs new file mode 100644 index 0000000..38a362e --- /dev/null +++ b/B3_QiLianMuGe/TypeIOCs/SaleOutStoreDoNullifyDoSomethingIoc.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3CowButcherManage.BO; +using BWP.B3Frameworks; +using BWP.B3Sale.BL; +using BWP.B3Sale.BO; +using BWP.B3Sale.Utils; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; + +namespace B3_QiLianMuGe.TypeIOCs +{ + [TypeIOC(typeof(SaleOutStoreBL), typeof(SaleOutStoreBL.IDoNullifyDoSomething))] + class SaleOutStoreDoNullifyDoSomethingIOC : SaleOutStoreBL.IDoNullifyDoSomething + { + public void Invoke(SaleOutStore outStore, IDmoSession session) + { + var billType = DmoTypeIDAttribute.GetID(typeof(SaleOutStore)); + DeleteByFunc(session, () => { return DQCondition.And(DQCondition.EQ("BillID", outStore.ID), DQCondition.EQ("BillType", billType)); }); + DeleteByFunc(session, () => { return DQCondition.EQ("BillID", outStore.ID); }); + UpdateSaleOutStoreInfo(session,outStore.ID); + UpdateAssignGoodsInfo(session,outStore.ID); + } + + private void UpdateSaleOutStoreInfo(IDmoSession session, long id) + { + var update = new DQUpdateDom(typeof(SaleOutStore)); + update.Columns.Add(new DQUpdateColumn("AssignState", DQExpression.Value(配货状态.未配货))); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + session.ExecuteNonQuery(update); + + var update2 = new DQUpdateDom(typeof(SaleOutStore)); + update2.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1)))); + update2.Where.Conditions.Add(DQCondition.EQ("ID", id)); + session.ExecuteNonQuery(update2); + } + + public static void UpdateAssignGoodsInfo(IDmoSession session, long? billID) + { + var update = new DQUpdateDom(typeof(BarCodeProductionInfo)); + update.Columns.Add(new DQUpdateColumn("IsAssignGoods", false)); + update.Columns.Add(new DQUpdateColumn("AssignBillID", DQExpression.NULL)); + update.Where.Conditions.Add(DQCondition.EQ("AssignBillID",billID)); + session.ExecuteNonQuery(update); + } + + void DeleteByFunc(IDmoSession session, Func func) + { + var delete = new DQDeleteDom(typeof(T)); + delete.Where.Conditions.Add(func()); + session.ExecuteNonQuery(delete); + } + } +}