|
|
@ -23,6 +23,7 @@ using Forks.Utils.Collections; |
|
|
using BWP.B3Sale.Utils; |
|
|
using BWP.B3Sale.Utils; |
|
|
using BWP.B3Frameworks; |
|
|
using BWP.B3Frameworks; |
|
|
using BWP.B3UnitedInfos; |
|
|
using BWP.B3UnitedInfos; |
|
|
|
|
|
using BWP.B3Frameworks.BO.NamedValueTemplate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
@ -33,6 +34,7 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
private DFChoiceBox _accountingUnitDfc; |
|
|
private DFChoiceBox _accountingUnitDfc; |
|
|
private DFChoiceBox _goodsDfc; |
|
|
private DFChoiceBox _goodsDfc; |
|
|
private DFBrowseGrid _grid; |
|
|
private DFBrowseGrid _grid; |
|
|
|
|
|
private DFBrowseGrid _gridNew; |
|
|
|
|
|
|
|
|
protected override void InitForm(HtmlForm form) |
|
|
protected override void InitForm(HtmlForm form) |
|
|
{ |
|
|
{ |
|
|
@ -95,6 +97,52 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
row.Cells[0].InnerHtml = "<a target='_blank' href='' onclick=\"var returnValue = " + string.Format("ShowDialog('{0}'); ", url) + @"return false;"">" + row.Cells[0].InnerHtml + "</a>"; |
|
|
row.Cells[0].InnerHtml = "<a target='_blank' href='' onclick=\"var returnValue = " + string.Format("ShowDialog('{0}'); ", url) + @"return false;"">" + row.Cells[0].InnerHtml + "</a>"; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
_gridNew = vPanel.Add(new DFBrowseGrid(new DFDataTableEditor()), new VLayoutOption(HorizontalAlign.Center)); |
|
|
|
|
|
_gridNew.Width = Unit.Percentage(50); |
|
|
|
|
|
_gridNew.Add(new DFBrowseGridAutoColumn("Goods_ID")); |
|
|
|
|
|
_gridNew.DFGridSetEnabled = false; |
|
|
|
|
|
_gridNew.OnDetailDataBound = (row, obj, index) => |
|
|
|
|
|
{ |
|
|
|
|
|
var dataRow = obj as DFDataRow; |
|
|
|
|
|
if (dataRow == null) |
|
|
|
|
|
{ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
var goodsID = dataRow["Goods_ID"]; |
|
|
|
|
|
var url = AspUtil.UpdateUrlParam("GoodsPackageDetailSet.aspx", "goodsID", goodsID.ToString()); |
|
|
|
|
|
if (!string.IsNullOrEmpty(_accountingUnitDfc.Value)) |
|
|
|
|
|
{ |
|
|
|
|
|
url = AspUtil.UpdateUrlParam(url, "accID", _accountingUnitDfc.Value); |
|
|
|
|
|
} |
|
|
|
|
|
row.Cells[0].InnerHtml = "<a target='_blank' href='' onclick=\"var returnValue = " + string.Format("ShowDialog('{0}'); ", url) + @"return false;"">" + row.Cells[0].InnerHtml + "</a>"; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
_gridNew.Columns.EAdd(new DFGridCustomExtColumn(delegate(object obj, HtmlTableCell cell, int rowIndex) |
|
|
|
|
|
{ |
|
|
|
|
|
DFDataRow dr = obj as DFDataRow; |
|
|
|
|
|
if (dr != null) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
string accName = (string)dr["会计单位"] ?? ""; |
|
|
|
|
|
var smallPackNum = int.Parse((dr["内包装物数量"] == null ? "0" : dr["内包装物数量"].ToString())); |
|
|
|
|
|
string name1 = (string)dr["封口"] ?? ""; |
|
|
|
|
|
string name2 = (string)dr["外包装"] ?? ""; |
|
|
|
|
|
string name3 = (string)dr["箱子"] ?? ""; |
|
|
|
|
|
string name4 = (string)dr["内包装"] ?? ""; |
|
|
|
|
|
|
|
|
|
|
|
var price1 = GetWrappageUnitPrice(accName, name1) ?? 0; |
|
|
|
|
|
var price2 = GetWrappageUnitPrice(accName, name2) ?? 0; |
|
|
|
|
|
var price3 = GetWrappageUnitPrice(accName, name3) ?? 0; |
|
|
|
|
|
var price4 = GetWrappageUnitPrice(accName, name4) ?? 0; |
|
|
|
|
|
var price = price1 + price2 + price3 + price4 * smallPackNum; |
|
|
|
|
|
|
|
|
|
|
|
var lb = new Label(); |
|
|
|
|
|
lb.Text = price.ToString(); |
|
|
|
|
|
cell.Controls.Add(lb); |
|
|
|
|
|
} |
|
|
|
|
|
})).HeaderText = "价格"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,16 +177,31 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void GridDataBind(bool configured = false) |
|
|
private void GridDataBind(bool configured = false) |
|
|
{ |
|
|
{ |
|
|
_grid.Query = GetDQueryDom(configured); |
|
|
|
|
|
_grid.CurrentPageIndex = 0; |
|
|
|
|
|
_grid.DataBind(); |
|
|
|
|
|
|
|
|
if (configured) |
|
|
|
|
|
{ |
|
|
|
|
|
_gridNew.Query = GetDQueryDom(configured); |
|
|
|
|
|
_gridNew.CurrentPageIndex = 0; |
|
|
|
|
|
_gridNew.DataBind(); |
|
|
|
|
|
_gridNew.Visible = true; |
|
|
|
|
|
_grid.Visible = false; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_grid.Query = GetDQueryDom(configured); |
|
|
|
|
|
_grid.CurrentPageIndex = 0; |
|
|
|
|
|
_grid.DataBind(); |
|
|
|
|
|
_gridNew.Visible = false; |
|
|
|
|
|
_grid.Visible = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void DoGridDataBind() |
|
|
public void DoGridDataBind() |
|
|
{ |
|
|
{ |
|
|
_grid.DataBind(); |
|
|
_grid.DataBind(); |
|
|
|
|
|
_gridNew.DataBind(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private DQueryDom GetDQueryDom(bool configured = false) |
|
|
private DQueryDom GetDQueryDom(bool configured = false) |
|
|
@ -275,5 +338,25 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据会计单位和包装物名称 得到 包装物单价
|
|
|
|
|
|
private decimal? GetWrappageUnitPrice(string accName, string wrappageName) |
|
|
|
|
|
{ |
|
|
|
|
|
JoinAlias main = new JoinAlias(typeof(WrappageUnitPrice)); |
|
|
|
|
|
JoinAlias detail = new JoinAlias(typeof(WrappageUnitPrice_Detail)); |
|
|
|
|
|
DQueryDom dom = new DQueryDom(main); |
|
|
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "WrappageUnitPrice_ID")); |
|
|
|
|
|
//dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "OldPrice")), "OldPrice"));
|
|
|
|
|
|
dom.Columns.Add(DQSelectColumn.Field("OldPrice", detail)); |
|
|
|
|
|
|
|
|
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(main, "BillState", 单据状态.已审核)); |
|
|
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(main, "AccountingUnit_Name", accName)); |
|
|
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(detail, "Wrappage_Name", wrappageName)); |
|
|
|
|
|
var price = (decimal?)dom.EExecuteScalar(); |
|
|
|
|
|
|
|
|
|
|
|
return price; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |