Browse Source

需求单No.137613

master
luanhui 8 years ago
parent
commit
4432f82b37
4 changed files with 113 additions and 1 deletions
  1. +3
    -0
      BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj
  2. +59
    -0
      BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/ProduceFinishEdit_Ext.cs
  3. +49
    -1
      BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs
  4. +2
    -0
      BWP.B3_YunKen.Web/PluginClass.cs

+ 3
- 0
BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj View File

@ -87,6 +87,9 @@
<Compile Include="Pages\B3YunKen\Overlays\OrderEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3YunKen\Overlays\ProduceFinishEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3YunKen\Overlays\ProductNoticeEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>


+ 59
- 0
BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/ProduceFinishEdit_Ext.cs View File

@ -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<ProduceFinish_Detail> LoadList()
{
var list=new List<ProduceFinish_Detail>();
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;
}
}
}

+ 49
- 1
BWP.B3_YunKen.Web/Pages/B3YunKen/Overlays/SaleForecastEdit_Ext.cs View File

@ -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<SaleForecast_Detail> LoadList()
{
var list=new List<SaleForecast_Detail>();
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;
}
}
}

+ 2
- 0
BWP.B3_YunKen.Web/PluginClass.cs View File

@ -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()


Loading…
Cancel
Save