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