zoukankan      html  css  js  c++  java
  • [K/3Cloud]调用动态表单时,传递自定义参数

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

    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("OrgId", (this.View.Model.GetValue("FUseOrgId") as DynamicObject)["Id"].ToString());
                this.View.ShowForm(ShowPara);
            }
    

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

    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");
                
            }
    
        }


  • 相关阅读:
    Effective C++:条款14:在中小企业资源管理copying表现
    Linux在iptables教程基本应用防火墙
    C++内存分配和拷贝构造函数写研究
    Codeforces 479E Riding in a Lift(dp)
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
  • 原文地址:https://www.cnblogs.com/fyq891014/p/4188849.html
Copyright © 2011-2022 走看看