From f734bb25924ccc843683e6922b43378d6be20330 Mon Sep 17 00:00:00 2001 From: duanluohua Date: Mon, 8 Jan 2018 16:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.138109=20?= =?UTF-8?q?=E3=80=90=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5{=E7=A7=BB=E5=8A=A8=E7=94=B5?= =?UTF-8?q?=E8=AF=9D}=EF=BC=8C=E4=BF=9D=E5=AD=98=E6=97=B6=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=AE=A2=E6=88=B7=E5=90=8D=E7=A7=B0=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E2=80=98=E8=81=94=E7=B3=BB=E4=BA=BA=E2=80=99?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E7=9A=84=E4=B8=80=E6=9D=A1=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E7=9A=84=E7=A7=BB=E5=8A=A8=E7=94=B5=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/B3YunKen/Overlays/OrderEdit_Ext.cs | 1 + BWP.B3_YunKen/BWP.B3_YunKen.csproj | 1 + .../TypeIoc/SaleOrderCustomerPhoneTypeIoc.cs | 33 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 BWP.B3_YunKen/TypeIoc/SaleOrderCustomerPhoneTypeIoc.cs diff --git a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs index d416b01..961f9ef 100644 --- a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs +++ b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/OrderEdit_Ext.cs @@ -16,6 +16,7 @@ namespace BWP.Web.Pages.B3YunKen.Overlays config.Add("EngineNumber"); config.Add("VinNO"); config.Add("HandcarNumber"); + config.Add("CellPhone"); } protected override void AddFreightConfig(LayoutManager layOutManager, AutoLayoutConfig config) diff --git a/BWP.B3_YunKen/BWP.B3_YunKen.csproj b/BWP.B3_YunKen/BWP.B3_YunKen.csproj index ffd6029..f6c6fa2 100644 --- a/BWP.B3_YunKen/BWP.B3_YunKen.csproj +++ b/BWP.B3_YunKen/BWP.B3_YunKen.csproj @@ -75,6 +75,7 @@ + diff --git a/BWP.B3_YunKen/TypeIoc/SaleOrderCustomerPhoneTypeIoc.cs b/BWP.B3_YunKen/TypeIoc/SaleOrderCustomerPhoneTypeIoc.cs new file mode 100644 index 0000000..d0cf67d --- /dev/null +++ b/BWP.B3_YunKen/TypeIoc/SaleOrderCustomerPhoneTypeIoc.cs @@ -0,0 +1,33 @@ +using System; +using BWP.B3Frameworks; +using BWP.B3Sale.BL; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; +using TSingSoft.WebPluginFramework; + +namespace BWP.B3_YunKen.TypeIoc +{ + [TypeIOC(typeof(OrderBL), typeof(OrderBL.IAddPhone))] + public class SaleOrderCustomerPhoneTypeIoc : OrderBL.IAddPhone + { + public void Invoke(Order dmo) + { + dmo.CellPhone = CustomerPhone(dmo.Customer_ID); + } + + private string CustomerPhone(long? CustomerId) + { + var main = new JoinAlias(typeof(Customer)); + var detail = new JoinAlias(typeof(CustomerLinkMan_Detail)); + var dom = new DQueryDom(detail); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(main), DQCondition.EQ(main, "ID", detail, "Customer_ID")); + dom.Where.Conditions.Add(DQCondition.And( DQCondition.EQ(detail, "Customer_ID", CustomerId), DQCondition.EQ(main, "ID", CustomerId))); + dom.Columns.Add(DQSelectColumn.Field("CellPhone", detail)); + dom.Range = SelectRange.Top(1); + var result = dom.EExecuteScalar(); + return result; + } + } +}