6.4、表单插件,警告式,提示信息框this.View.ShowWarnningMessage原创
金蝶云社区-林荫大道
林荫大道
5人赞赏了该文章 132次浏览 编辑于2020年7月2日 15:22:55



6.3、表单插件,询问式,提示信息框MessageBoxOptions.YesNo



1、注释,上一节代码



2、


               //警告
                this.View.ShowWarnningMessage
                    ("不能对其操作,请确认",
                    action: (result) =>
                    
                    
                        {
                            //关闭页面
                            this.View.Close();
                        }
                    );


3、重新生成dll



4、最终效果,打开销售订单,点按钮,黄色弹窗,点确定,关闭销售订单;


image.png


image.png



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//最基础的
using Kingdee.BOS;
//表单插件
using Kingdee.BOS.Core.Bill.PlugIn;
//说明
using System.ComponentModel;
using Kingdee.BOS.Core.DynamicForm;


namespace Kingdee.Bos.ProJect.BillMessage.Pluln
{
    //说明
    [Description("提示信息框")]
    
    //热启
    [Kingdee.BOS.Util.HotUpdate]
    
    
    //继承表单插件
    public class ClassName:AbstractBillPlugIn
    {
        //按钮点击事件
        public override void BarItemClick(BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
        {
            base.BarItemClick(e);
            
            
            //if条件判断,当点击YDIE_ tbGetSetValue这个按钮时候触发
            if(e.BarItemKey.Equals("YDIE_tbGetSetValue"))
            {
                //弹窗,你好
                //this.View.ShowMessage("你好");
                
                //错误信息,对话框
                //this.View.ShowErrMessage("严重错误");
                //this.View.ShowMessage("错误提示,是否继续?",
                //    //提示信息:是、否
                //MessageBoxOptions.YesNo,
                //    //通过result接收值
                //new Action<MessageBoxResult>((result) =>
                // {
                //     if (result == MessageBoxResult.Yes)
                //     {
                //         //如果选择的是,给备注赋值,是
                //         this.View.Model.SetValue("FNote", "您选择--是");
                //     }
                //     else if (result == MessageBoxResult.No)
                //     {
                //         //如果选择的否,给备注赋值,否
                //         this.View.Model.SetValue("FNote", "您选择--否");
                //     }
                // }));
                //this.View.ShowMessage("错误提示,是否继续?",
                //    //提示信息:是、否,取消
                //MessageBoxOptions.YesNoCancel,
                //    //通过result接收值
                //new Action<MessageBoxResult>((result) =>
                //{
                //    if (result == MessageBoxResult.Yes)
                //    {
                //        //如果选择的是,给备注赋值,是
                //        this.View.Model.SetValue("FNote", "您选择--是");
                //    }
                //    else if (result == MessageBoxResult.No)
                //    {
                //        //如果选择的否,给备注赋值,否
                //        this.View.Model.SetValue("FNote", "您选择--否");
                //    }
                //    else if (result == MessageBoxResult.Cancel)
                //    {
                //        //如果选择的取消,给备注赋值,取消
                //        this.View.Model.SetValue("FNote", "您选择--取消");
                //    }
                //}));
                //刷新一下备注
                //this.View.UpdateView("FNote");
               
               
               //警告
                this.View.ShowWarnningMessage
                    ("不能对其操作,请确认",
                    action: (result) =>
                        {
                            //关闭页面
                            this.View.Close();
                        }
                    );
            }
        }
    }
}



总目录链接

https://vip.kingdee.com/article/64993872014591232





5