按钮打开动态表单

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

按钮打开动态表单

using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TEST
{
    public class Global
    {
        /// <summary>
        /// 用户id
        /// </summary>
        public string F_PAEZ_Text1 { get; set; }
    }
    public class DTBD : AbstractDynamicFormPlugIn  //父类方法
    {

        public override void AfterBarItemClick(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.AfterBarItemClickEventArgs e)
        {
            base.AfterBarItemClick(e);

            if (e.BarItemKey.Equals("tbButton_2", StringComparison.OrdinalIgnoreCase))
            {
                DynamicFormShowParameter parameter = new DynamicFormShowParameter();

                //指定要打开的窗体ID
                parameter.FormId = "93741eb406774b1fb66fe4027f7c537b";
                //将客户ID添加到自定义参数中,以便在新窗体中获取
              /*  string F_PAEZ_Text1;
                if (this.View.Model.GetValue("F_PAEZ_Text1") != null)
                {
                    F_PAEZ_Text1 = this.View.Model.GetValue("F_PAEZ_Text1").ToString();
                }
                else
                {
                    F_PAEZ_Text1 = "";
                }
                parameter.CustomParams.Add("F_PAEZ_Text1", F_PAEZ_Text1); */
                this.View.ShowForm(parameter,
                          new Action<FormResult>((formResult) =>
                          {
                              if (formResult != null && formResult.ReturnData != null)
                              {
                                  this.Model.SetValue("F_PAEZ_Text1",
                                      ((Global)formResult.ReturnData).F_PAEZ_Text1);
                              }
                          }));
            }
            base.AfterBarItemClick(e);
        }


    }
        public class SubMain : AbstractDynamicFormPlugIn   //子单据方法
        {
            /*   private string F_PAEZ_Text1;

             public override void OnInitialize(InitializeEventArgs e)
             {
                 F_PAEZ_Text1 = Convert.ToString(e.Paramter.GetCustomParameter("F_PAEZ_Text1"));

                 base.OnInitialize(e);
             }
           public override void BeforeBindData(EventArgs e)
             {
                 base.BeforeBindData(e);
                 if (F_PAEZ_Text1 != "" && F_PAEZ_Text1 != null)
                 {
                     this.View.Model.SetValue("F_PAEZ_Text1", F_PAEZ_Text1);
                 }

             }*/
 


            public override void AfterButtonClick(AfterButtonClickEventArgs e)
            {
                Global text1 = new Global();
                if (e.Key == "F_BZ_BUTTON")
                {
                    if (this.Model.GetValue("F_PAEZ_Text") != null)
                    {
                        text1.F_PAEZ_Text1 = this.Model.GetValue("F_PAEZ_Text").ToString();
                    }
                    else
                    {
                        text1.F_PAEZ_Text1 = "";
                    }

                    this.View.ReturnToParentWindow(new FormResult(text1));
                    this.View.Close();
                }
                if (e.Key == "F_BZ_BUTTON1")
                {
                    this.View.Close();
                }
                base.AfterButtonClick(e);
            }
        }
    }





按钮打开动态表单

using Kingdee.BOS.Core.Bill.PlugIn;using Kingdee.BOS.Core.DynamicForm;using Kingdee.BOS.Core.DynamicForm.PlugIn;using Kingdee....
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息