这篇文章距离最后更新已过176 天,如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
U9C 销售订单UI触发系统标准的价格联动计算
using System;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.Engine.Builder;
using System.Web.UI;
using System.Collections.Specialized;
using UFIDA.U9.SCM.SD.ShipUIModel;
using UFIDA.U9.MO.IssueTXN.IssueTXNUIModel;
namespace UFIDA.U9.CWJ.UIPlugIn
{
public class SOUIExtend : UFSoft.UBF.UI.Custom.ExtendedPartBase
{
private StandardSOMainUIFormWebPart MyPart;
// 修改扩展字段双单位单价触发价税合计更新
void Register_DataGrid4_ExportTotalMoney_PostBack()
{
var DataGrid4 = (IUFDataGrid)MyPart.FindControl("DataGrid4");
var assocControl = new AssociationControl
{
SourceServerControl = DataGrid4
};
assocControl.SourceControl.EventName = "OnCellDataValueChanged";
((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("DescFlexField_PrivateDescSeg16");
var cb = new CodeBlock();
var gridAdapter = new UFWebClientGridAdapter(DataGrid4)
{
IsPostBack = true,
PostBackTag = "OnCellDataValueChanged"
};
cb.TargetControls.addControl(gridAdapter);
assocControl.addBlock(cb);
var itemGrid = DataGrid4 as UFGrid;
itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(GridCellOnChanged_DoCustomerAction_Grid);
}
void GridCellOnChanged_DoCustomerAction_Grid(object sender, GridCustomerPostBackEventArgs e)
{
MyPart.IsDataBinding = true;
MyPart.IsConsuming = true;
MyPart.DataCollect();
MyPart.DataBinding();
var SOLine = MyPart.Model.SO_SOLines.Records[e.RowIndex] as SO_SOLinesRecord;
if (string.IsNullOrEmpty(SOLine.DescFlexField_PrivateDescSeg16)) return;
// 赋值价税合计
SOLine.TotalMoneyTC = Convert.ToDecimal(SOLine.DescFlexField_PrivateDescSeg16) * SOLine.OrderByQtyTU;
// 变更的值
var hashtable6 = new Hashtable(2)
{
["RECORDID"] = SOLine.ID,
["OLDVALUE"] = SOLine.TotalMoneyTC
};
var uIActionEventArgs6 = new UIActionEventArgs
{
Tag = hashtable6
};
// 执行价税合计触发的联动计算
MyPart.Action.OnTotalMoneyTCChange(MyPart, uIActionEventArgs6);
}
}
}