[K/3Cloud] 动态表单打开时传递一个自定义参数并在插件中获取

插件中在调用动态表单时,通过DynamicFormShowParameter的CustomParams,增加自定义的参数。

/// <summary>
        /// 库存查询
        /// </summary>
        private void ShowMaterialStock()
        {
            object useOrgId = (this.View.Model.GetValue("FUseOrgId") as DynamicObject)["Id"];
            object materialId = this.View.Model.GetPKValue();
            List<long> orgIds = PermissionServiceHelper.GetPermissionOrg(this.Context, new BusinessObject() { Id = K3.Core.SCM.SCMFormIdConst.STK_Inventory }, PermissionConst.View);

            DynamicFormShowParameter ShowPara = new DynamicFormShowParameter();
            ShowPara.ParentPageId = this.View.PageId;
            ShowPara.MultiSelect = false;
            ShowPara.FormId = K3.Core.SCM.SCMFormIdConst.STK_InventoryQuery;
            ShowPara.Height = 600;
            ShowPara.Width = 1000;
            string filter = string.Format(" FStockOrgId = {0} And FMaterialId = {1} And FOwnerTypeId='BD_OwnerOrg' And FOwnerId={2} ", useOrgId, materialId, useOrgId);
            ShowPara.CustomParams.Add("QueryFilter", filter);
            ShowPara.CustomParams.Add("QueryOrgId", (this.View.Model.GetValue("FUseOrgId") as DynamicObject)["Id"].ToString());
            this.View.ShowForm(ShowPara);
        }



目标单据的插件中,通过View.OpenParameter.GetCustomParameter("xxx")获取传递的自定义参数:

/// <summary>
    /// 即时库存查询界面插件
    /// </summary>
    public class InventoryQuery : AbstractDynamicFormPlugIn
    {
        public override void OnInitialize(InitializeEventArgs e)
        {
            base.OnInitialize(e);
            object paraQueryFilter = this.View.OpenParameter.GetCustomParameter("QueryFilter");
            object paraOrgId = this.View.OpenParameter.GetCustomParameter("QueryOrgId");
            
        }
    }


转载于:https://my.oschina.net/fanyongqiang/blog/654537

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值