diff --git a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj index 98bb6f5..276d5af 100644 --- a/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj +++ b/BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj @@ -87,6 +87,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind diff --git a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/ProduceFinishEdit_Ext.cs b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/ProduceFinishEdit_Ext.cs new file mode 100644 index 0000000..c245ad6 --- /dev/null +++ b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/ProduceFinishEdit_Ext.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Butchery.BO; +using BWP.B3Sale.BO; +using BWP.Web.Pages.B3Butchery.Bills.ProduceFinish_; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; +using TSingSoft.WebControls2; + +namespace BWP.Web.Pages.B3YunKen.Overlays +{ + class ProduceFinishEdit_Ext: ProduceFinishEdit + { + protected override void AddCustomerToolBar(HLayoutPanel hPanel) + { + var btn = new TSButton("载人生产存货"); + btn.Click += Btn_Click; + hPanel.Add(btn); + } + private void Btn_Click(object sender, EventArgs e) + { + Dmo.Details.Clear(); + foreach (ProduceFinish_Detail detail in LoadList()) + { + Dmo.Details.Add(detail); + } + _detailGrid.DataBind(); + } + + private IEnumerable LoadList() + { + var list=new List(); + + var bill = new JoinAlias(typeof(ProductionGoodsTable)); + var detail = new JoinAlias(typeof(ProductionGoodsTable_Detail)); + var query = new DQueryDom(bill); + query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(bill, "ID", detail, "ProductionGoodsTable_ID")); + query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID", Dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.EQ("ProductionUnit_ID", Dmo.ProductionUnit_ID)); + query.Columns.Add(DQSelectColumn.Field("SaleGoods_ID", detail)); + query.Columns.Add(DQSelectColumn.Field("Goods_Name", detail)); + using (var session = Forks.EnterpriseServices.DomainObjects2.Dmo.NewSession()) + { + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + list.Add(new ProduceFinish_Detail() { Goods_ID = (long)reader[0], Goods_Name = (string)reader[1] }); + } + } + } + + return list; + } + } +} diff --git a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs index 42d1add..796e699 100644 --- a/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs +++ b/BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs @@ -3,15 +3,63 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using BWP.B3Sale.BO; using BWP.Web.Layout; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; +using TSingSoft.WebControls2; namespace BWP.Web.Pages.B3YunKen.Overlays { public class SaleForecastEdit_Ext: SaleForecastEdit { - protected override void AddYunKenFreightBearConfig(AutoLayoutConfig config) + protected override void AddCustomerLayoutConfig(AutoLayoutConfig config) { config.AddAfter("FreightBear", "DeliverAddress"); } + + protected override void AddCustomerToolBar(HLayoutPanel toobar) + { + var btn=new TSButton("载人存货"); + btn.Click += Btn_Click; + toobar.Add(btn); + } + + private void Btn_Click(object sender, EventArgs e) + { + Dmo.Details.Clear(); + foreach (SaleForecast_Detail detail in LoadList()) + { + Dmo.Details.Add(detail); + } + _detailGrid.DataBind(); + } + + List LoadList() + { + var list=new List(); + + var bill = new JoinAlias(typeof(CustomerGoodsTable)); + var detail = new JoinAlias(typeof(CustomerGoodsTable_Detail)); + var query = new DQueryDom(bill); + query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(bill, "ID", detail, "CustomerGoodsTable_ID")); + query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID", Dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.EQ("Customer_ID", Dmo.Customer_ID)); + query.Columns.Add(DQSelectColumn.Field("SaleGoods_ID", detail)); + query.Columns.Add(DQSelectColumn.Field("Goods_Name", detail)); + using (var session=Forks.EnterpriseServices.DomainObjects2.Dmo.NewSession()) + { + using (var reader=session.ExecuteReader(query)) + { + while (reader.Read()) + { + list.Add(new SaleForecast_Detail(){SaleGoods_ID = (long)reader[0],Goods_Name = (string)reader[1]}); + } + } + } + return list; + } + } } diff --git a/BWP.B3_YunKen.Web/PluginClass.cs b/BWP.B3_YunKen.Web/PluginClass.cs index bc18598..27ff5cf 100644 --- a/BWP.B3_YunKen.Web/PluginClass.cs +++ b/BWP.B3_YunKen.Web/PluginClass.cs @@ -1,6 +1,7 @@ using BWP.B3Sale; using TSingSoft.WebPluginFramework; using BWP.B3UnitedInfos; +using BWP.Web.Pages.B3Butchery.Bills.ProduceFinish_; using TSingSoft.WebPluginFramework.Pages; using BWP.Web.Pages.B3Sale.Bills.Order_; using BWP.Web.Pages.B3YunKen.Overlays; @@ -26,6 +27,7 @@ namespace BWP.B3_YunKen.Web WpfPageFactory.RegisterPageOverlay(typeof(SaleForecastEdit).FullName, typeof(SaleForecastEdit_Ext).FullName); WpfPageFactory.RegisterPageOverlay(typeof(ProductNoticeEdit).FullName, typeof(ProductNoticeEdit_Ext).FullName); WpfPageFactory.RegisterPageOverlay(typeof(ProductNoticeReport).FullName, typeof(ProductNoticeReport_Ext).FullName); + WpfPageFactory.RegisterPageOverlay(typeof(ProduceFinishEdit).FullName, typeof(ProduceFinishEdit_Ext).FullName); } public void OnUnitInit()