7.2、表单插件,处理结果信息提示框,循环原创
金蝶云社区-林荫大道cc
林荫大道cc
11人赞赏了该文章 6140次浏览 未经作者许可,禁止转载编辑于2020年07月02日 15:24:38
封面


7.1、表单插件,处理结果信息提示框




1、注释,上一节代码



2、


IOperationResult opResult = new OperationResult();
                //FOR 循环
                for (int i = 1; i <= 20; i++ )
                { 
                    //如果是奇数
                    if(Convert.ToBoolean(i%2))
                    {
                    opResult.OperateResult.Add(new OperateResult()
                    {
                        Name = "信息提示",
                        //成功状态,提示
                        Message = i.ToString()+"---奇数成功",
                        SuccessStatus = true
                    });
                        }
                    else
                    {
                    opResult.OperateResult.Add(new OperateResult()
                    {
                    Name = "信息提示",
                    //失败状态,提示
                    Message =i.ToString()+ "---偶数失败",
                    SuccessStatus = false
                    });
                    }
                }
                this.View.ShowOperateResult(opResult.OperateResult);



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.ProjectName.BillInfo
{
    //插件名字
    [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 == "YDIE_tbGetSetValue")
            {
                //IOperationResult opResult = new OperationResult();
                //opResult.OperateResult.Add(new OperateResult()
                //{
                //    Name = "信息提示",
                //    //成功状态,提示
                //    Message = "成功",
                //    SuccessStatus = true
                //});
                //this.View.ShowOperateResult(opResult.OperateResult);
                //opResult.OperateResult.Add(new OperateResult()
                //{
                //    Name = "信息提示",
                //    //失败状态,提示
                //    Message = "失败",
                //    SuccessStatus = false
                //});
                //this.View.ShowOperateResult(opResult.OperateResult);
                
                
                IOperationResult opResult = new OperationResult();
                //FOR 循环
                for (int i = 1; i <= 20; i++ )
                { 
                    //如果是奇数
                    if(Convert.ToBoolean(i%2))
                    {
                    opResult.OperateResult.Add(new OperateResult()
                    {
                        Name = "信息提示",
                        //成功状态,提示
                        Message = i.ToString()+"---奇数成功",
                        SuccessStatus = true
                    });
                        }
                    else
                    {
                    opResult.OperateResult.Add(new OperateResult()
                    {
                    Name = "信息提示",
                    //失败状态,提示
                    Message =i.ToString()+ "---偶数失败",
                    SuccessStatus = false
                    });
                    }
                }
                this.View.ShowOperateResult(opResult.OperateResult);
            }
         
            }
        }
    
}


总目录链接

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




赞 11