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; + } + } +}