如何将销售订单字段携带到产品配置表头?原创
7人赞赏了该文章
995次浏览
编辑于2021年09月26日 17:14:24
一、如何将销售订单字段携带到产品配置表头?下面以携带销售订单分录行备注字段为例:
销售订单表单插件代码示例:
using Kingdee.BOS.Core.Bill.PlugIn; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Kingdee.BOS.Util; using Kingdee.BOS.Core.DynamicForm; using Kingdee.K3.Core.MFG.EntityHelper; using Kingdee.BOS.Orm.DataEntity; using System.ComponentModel; namespace Kingdee.K3.MFG.PRD.Business.PlugIn { [Description("携带销售订单分录行备注信息到产品配置界面")] public class Ext_SalEdit : AbstractBillPlugIn { public override void EntryBarItemClick(BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e) { base.EntryBarItemClick(e); if (e.BarItemKey.EqualsIgnoreCase("tbBomConfig")) { int rowIndex = this.View.Model.GetEntryCurrentRowIndex("FSaleOrderEntry"); DynamicObject entryData = this.View.Model.DataObject.GetDynamicValue<DynamicObjectCollection>("SaleOrderEntry")[rowIndex]; string entryNote = entryData.GetDynamicValue<string>("Note"); if (entryNote.IsNullOrEmptyOrWhiteSpace()) return; string strSessionValue = "SessionValue"; this.View.Session[strSessionValue] = entryNote; } } } }
产品配置表单插件代码示例:
using Kingdee.BOS.Core.Bill.PlugIn; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using Kingdee.BOS.Util; using Kingdee.K3.Core.MFG.EntityHelper; namespace Kingdee.K3.MFG.PRD.Business.PlugIn { [Description("产品配置填写销售订单携带过来的备注信息")] public class Ext_BomConfigEdit : AbstractBillPlugIn { public override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.View.ParentFormView != null) { string strNote = this.View.ParentFormView.Session["SessionValue"].ConvertTo<string>(); if (strNote.IsNullOrEmptyOrWhiteSpace()) return; this.View.Model.SetValue("FMulLangText", strNote); } } } }
推荐阅读