diff --git a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj index d15ccb4..fd64652 100644 --- a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj +++ b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj @@ -97,6 +97,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind @@ -137,6 +140,7 @@ ASPXCodeBehind + diff --git a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/CustomerApplyEdit_Ext.cs b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/CustomerApplyEdit_Ext.cs new file mode 100644 index 0000000..c65c6a2 --- /dev/null +++ b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/CustomerApplyEdit_Ext.cs @@ -0,0 +1,24 @@ +using BWP.B3Butchery.BO; +using BWP.Web.Pages.B3Butchery.Bills.ProductInStore_; +using BWP.Web.Utils; +using BWP.Web.WebControls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TSingSoft.WebControls2; +using BWP.Web.Pages.B3Sale.Bills.CustomerApply_; + +namespace BWP.Web.Pages.B3YunKen.Overlays +{ + public class CustomerApplyEdit_Ext : CustomerApplyEdit + { + public override void AddConfig(Layout.AutoLayoutConfig config) + { + base.AddConfig(config); + config.AddBefore("SalePeople_ID", "Remark"); + config.AddAfter("Dealer_ID", "SalePeople_ID"); + config.AddAfter("OfficeAddress", "Dealer_ID"); + } + } +} diff --git a/BWP.B3_YunKen.Web/Pages/TypeIOCs/CustomerEditAddBasePropertiesIOC.cs b/BWP.B3_YunKen.Web/Pages/TypeIOCs/CustomerEditAddBasePropertiesIOC.cs new file mode 100644 index 0000000..d77db8a --- /dev/null +++ b/BWP.B3_YunKen.Web/Pages/TypeIOCs/CustomerEditAddBasePropertiesIOC.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Frameworks; +using BWP.Web.Pages.B3Sale.BaseInfos; +using BWP.Web.Pages.B3Sale.Bills.GoodsApply_; + +namespace BWP.Web.Pages.TypeIOCs +{ + [TypeIOC(typeof(CustomerEdit), typeof(CustomerEdit.BaseDmoEditPageIOCs.BeforeBasePropertiesApplyLayout))] + public class CustomerEditAddBasePropertiesIOC : CustomerEdit.BaseDmoEditPageIOCs.BeforeBasePropertiesApplyLayout + { + public void Invoke(System.Web.UI.Page page, Layout.LayoutManager manager, Layout.AutoLayoutConfig config, CustomPageLayout.PageLayoutSection section) + { + config.AddBefore("SalePeople_ID", "Remark"); + config.AddAfter("Dealer_ID", "SalePeople_ID"); + config.AddAfter("OfficeAddress", "Dealer_ID"); + } + } + +} diff --git a/BWP.B3_YunKen.Web/PluginClass.cs b/BWP.B3_YunKen.Web/PluginClass.cs index 905851f..23d605c 100644 --- a/BWP.B3_YunKen.Web/PluginClass.cs +++ b/BWP.B3_YunKen.Web/PluginClass.cs @@ -10,6 +10,7 @@ using BWP.Web.Pages.B3Sale.Bills.SaleForecast_; using BWP.Web.Pages.B3Butchery.Bills.ProductNotice_; using BWP.Web.Pages.B3Butchery.Reports.ProductNoticeReport_; using BWP.Web.Pages.B3Butchery.Bills.ProductInStore_; +using BWP.Web.Pages.B3Sale.Bills.CustomerApply_; namespace BWP.B3_YunKen.Web { @@ -20,7 +21,6 @@ namespace BWP.B3_YunKen.Web GlobalFlags.On(B3SaleConsts.Flags.EnableStandardGoods); GlobalFlags.On(B3SaleConsts.Flags.RecordLastSaleOutStoreDate); GlobalFlags.On(B3SaleConsts.Flags.IsYunKen); - GlobalFlags.On(B3SaleConsts.Flags.DriverNameAllowSame); GlobalFlags.On(B3UnitedInfosConsts.GlobalFlags.库存支持品牌项); //GlobalFlags.On(B3UnitedInfosConsts.GlobalFlags.产品线增加字段上级产品线); @@ -31,6 +31,7 @@ namespace BWP.B3_YunKen.Web WpfPageFactory.RegisterPageOverlay(typeof(ProductNoticeReport).FullName, typeof(ProductNoticeReport_Ext).FullName); WpfPageFactory.RegisterPageOverlay(typeof(ProduceFinishEdit).FullName, typeof(ProduceFinishEdit_Ext).FullName); WpfPageFactory.RegisterPageOverlay(typeof(ProductInStoreEdit).FullName, typeof(ProduceFinishBtnExt).FullName); + WpfPageFactory.RegisterPageOverlay(typeof(CustomerApplyEdit).FullName, typeof(CustomerApplyEdit_Ext).FullName); } public void OnUnitInit() diff --git a/BWP.B3_YunKen/BLActions/CustomerDealerBLAction.cs b/BWP.B3_YunKen/BLActions/CustomerDealerBLAction.cs new file mode 100644 index 0000000..4f04890 --- /dev/null +++ b/BWP.B3_YunKen/BLActions/CustomerDealerBLAction.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Sale.BL; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.BusinessInterfaces; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using TSingSoft.WebPluginFramework.BIPlugins.BLEvents; + +namespace BWP.B3_YunKen.BLActions +{ + public class CustomerDealerBLAction : IBLMethodAction + { + public string Description + { + get { return "若所选择【经销商】档案明细没有此客户,则在【经销商】中下插入一条明细"; } + } + + public void Execute(Forks.EnterpriseServices.BusinessInterfaces.IDmoContext context, object dmo, object parameter) + { + var customer = dmo as Customer; + if (customer!=null && !customer.IsDealers && customer.Dealer_ID != null) { + var query = new DQueryDom(new JoinAlias(typeof(Dealer_Detail))); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Where.Conditions.Add(DQCondition.EQ("Dealer_ID", customer.Dealer_ID)); + query.Where.Conditions.Add(DQCondition.EQ("Customer_ID", customer.ID)); + var id = (long?)context.Session.ExecuteScalar(query); + if (id == null) { + var bl = BIFactory.Create(context.Session); + var dealer = bl.Load(customer.Dealer_ID.Value); + var detail = new Dealer_Detail(); + detail.Customer_ID = customer.ID; + dealer.Details.Add(detail); + bl.Update(dealer); + } + } + } + + public IList Features + { + get { return new List(); } + } + + public string Name + { + get { return "B3_HuaDu.若所选择【经销商】档案明细没有此客户,则在【经销商】中下插入一条明细"; } + } + } +} diff --git a/BWP.B3_YunKen/BWP.B3_YunKen.csproj b/BWP.B3_YunKen/BWP.B3_YunKen.csproj index 2818f01..0dcc8d8 100644 --- a/BWP.B3_YunKen/BWP.B3_YunKen.csproj +++ b/BWP.B3_YunKen/BWP.B3_YunKen.csproj @@ -61,10 +61,11 @@ - + - + +