4.7、表单插件,刷新,this.View.Refresh,Update原创
金蝶云社区-林荫大道_找工作身份
林荫大道_找工作
15人赞赏了该文章 1万次浏览 未经作者许可,禁止转载编辑于2020年07月02日 15:14:32
封面



4.6、表单插件,锁定、隐藏,按钮,this.View.GetMainBarItem()




1、注释,上一节代码



2、前台刷新,不和服务器交互


 this.View.UpdateView("FNote");



前面一节提到过,第5点,不方面演示数据,这里略过...

     

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




3、整个页面刷新,要和服务器交互,把后台数据库数据刷新过来

this.View.Refresh();



4、重新生成dll



5、新增一张暂存的销售订单,数据库查询 备注FNte,目前是空

select FNote,* from T_SAL_ORDER where FID =100053

image.png



6、数据库后台,更新备注的值,为FNote

update T_SAL_ORDER set FNote ='FNote' where FID =100053

image.png



7、销售订单列表,重新打开之前暂存的销售订单,点按钮,备注自动更新为FNote

image.png


image.png


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//引用插件,不管什么情况,先把这2个引用
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS;
//热启动,不用重启IIS
using System.ComponentModel;


namespace Kingdee.Bos.ProJectName.Bill.Plugln
{
    //插件名字
    [Description("表单插件,表单常用方法")]
    
    //热启动,不用重启IIS
    [Kingdee.BOS.Util.HotUpdate]
    
    
    //继承表单插件
    public class ClassName:AbstractBillPlugIn
    {
        //重写按钮点击事件
        public override void BarItemClick(BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
        {
            base.BarItemClick(e);
            
            
            //条件判断,当点击YDIE_ tbGetSetValue这个按钮时候触发
            if(e.BarItemKey =="YDIE_tbGetSetValue")
            {
                //获取单据标题 this.View.GetFormTitle()
                //string FormTitle = this.View.GetFormTitle();
                
                //显示出来,显示到备注上面,赋值给备注
                //this.View.Model.SetValue("FNote", FormTitle);
                
                //获取单据内码,并转换成字符串.ToString()
                //string FormTitle = this.View.Model.DataObject["Id"].ToString();
                
                //显示出来,显示到备注上面,赋值给备注
                //this.View.Model.SetValue("FNote", FormTitle);
                
                //获取单据内码,并转换成字符串.ToString()
                //string FormTitle = this.View.Model.GetPKValue().ToString();
                
                //显示出来,显示到备注上面,赋值给备注
                //this.View.Model.SetValue("FNote", FormTitle);
                
                //获取焦点,备注
                //this.View.GetControl("FNote").SetFocus();
                
                //点击按钮,备注字段锁定,变成灰色
                //this.View.GetControl("FNote").Enabled = false;
                
                //扩展使用,单据体,备注,行锁定字段
                //this.View.GetFieldEditor("FEntryNote",0).Enabled = false;
                
                //隐藏备注字段
                //this.View.GetControl("FNote").Visible = false;
                
                //锁定,保存按钮
                //this.View.GetMainBarItem("tbSplitSave").Enabled = false;
                
                //隐藏,保存按钮
                //this.View.GetMainBarItem("tbSplitSave").Visible = false;
                
                
                //刷新
                this.View.Refresh();
            }
        }
    }
}


总目录链接

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


赞 15