using System.Collections.Generic;
using System.Linq;
using System.Text;
//引用,单据体插件
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS;
using System.ComponentModel;
namespace Kingdee.Bos.Project.BillEntry.Plugln
{
//插件名字
[Description("单据体属性测试")]
//热启动
[Kingdee.BOS.Util.HotUpdate]
//继承表单插件类
public class ClassName:AbstractBillPlugIn
{
//单据体,按钮点击事件
public override void EntryBarItemClick(BOS.Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
{
base.EntryBarItemClick(e);
//if条件判断,当点击YDIE_tbTest这个按钮时候触发
if(e.BarItemKey.Equals("YDIE_tbTest"))
{
//删除单据体信息
//FSaleOrderEntry,代表订单明细
//this.View.Model.DeleteEntryData("FSaleOrderEntry");
//逐行,删除单据体分录,0代表第1行
//this.View.Model.DeleteEntryRow("FSaleOrderEntry", 0);
//新增行
//this.View.Model.CreateNewEntryRow("FSaleOrderEntry");
//类似上一节功能,复制行
//参数说明: 0代表第1行; 1代表复制到第2行; false代表不携带源单关系
//this.View.Model.CopyEntryRow("FSaleOrderEntry", 0, 1, false);
//获取单据体第1到3行内码,方便后续从数据库操作
//this.View.Model.GetEntryPKValue("FSaleOrderEntry", 0);
//this.View.Model.GetEntryPKValue("FSaleOrderEntry", 1);
//this.View.Model.GetEntryPKValue("FSaleOrderEntry", 2);
//赋值this.View.Model.SetValue();获取行的内码,赋值给新增的字段F_YDIE_EntryID
this.View.Model.SetValue("F_YDIE_EntryID", this.View.Model.GetEntryPKValue("FSaleOrderEntry", 0),0);
this.View.Model.SetValue("F_YDIE_EntryID", this.View.Model.GetEntryPKValue("FSaleOrderEntry", 1),1);
this.View.Model.SetValue("F_YDIE_EntryID", this.View.Model.GetEntryPKValue("FSaleOrderEntry", 2),2);
//刷新,单据体界面
this.View.UpdateView("FSaleOrderEntry");
}
}
}
}