/// <summary>
/// 注册列表本次发运数量值变化事件
/// </summary>
private void SchemaCallBack()
{
AssociationControl assocControl = new AssociationControl();//交互关联控件实例
assocControl.SourceServerControl = this.DataGrid8;//触发源控件
assocControl.SourceControl.EventName = "OnCellDataValueChanged"; // 触发事件
((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("ShipQty");
ClientCallBackFrm cbf = new ClientCallBackFrm();
cbf.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(DoCellDataValueChanged);//定义服务器端的处理方法
cbf.ParameterControls.Add(this.DataGrid8); //添加传送到服务器端的控件值
cbf.Add(assocControl);
this.Controls.Add(cbf);
}
/// <summary>
/// 本次发运数量值发生变化
/// </summary>
/// <param name="args"></param>
/// <returns>计算本行总体积,总重量</returns>
private object DoCellDataValueChanged(CustomerActionEventArgs args)
{
UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid8); // 列表
ArrayList list = (ArrayList)args.ArgsHash[this.DataGrid8.ClientID];
int curIndex = Convert.ToInt32(args.ArgsHash[UFWebClientGridAdapter.FocusRow]);
Hashtable hashT = (Hashtable)list[curIndex];
decimal volume = 0m;
decimal weight = 0m;
decimal shipQty = 0m;
decimal.TryParse(hashT["Volume"].ToString(), out volume);
decimal.TryParse(hashT["Weight"].ToString(), out weight);
decimal.TryParse(hashT["ShipQty"].ToString(), out shipQty);
decimal totalVolume = volume * shipQty;
decimal totalWeight = weight * shipQty;
grid.CellValue.Add(new object[] { curIndex, "TotalVolume", new string[] { totalVolume.ToString(), totalVolume.ToString(), totalVolume.ToString() } });
grid.CellValue.Add(new object[] { curIndex, "TotalWeight", new string[] { totalWeight.ToString(), totalWeight.ToString(), totalWeight.ToString() } });
args.ArgsResult.Add(grid.ClientInstanceWithValue);
return args;
}
版权属于:
秋驰雪隙
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
评论 (0)