二开案例.表单插件.锁定解锁单元格

【应用场景】
锁定解锁单据体的某个单元格。
【案例演示】
采购订单,修改界面,锁定解锁采购数量字段。
【实现步骤】
<1>编写表单插件,代码如下。
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using System.ComponentModel;
namespace Jac.XkDemo.BOS.Business.PlugIn
{
/// <summary>
/// 【表单插件】锁定解锁单元格
/// </summary>
[Description("【表单插件】锁定解锁单元格"), HotUpdate]
public class LockGridCellFormPlugIn : AbstractDynamicFormPlugIn
{
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
var entityKey = "FPOOrderEntry";
var entity = this.View.BusinessInfo.GetEntity(entityKey);
var fieldKey = this.Model.GetEntryCurrentFieldKey(entityKey);
var rowIndex = this.Model.GetEntryCurrentRowIndex(entityKey);
var rowData = this.Model.GetEntityDataObject(entity, rowIndex);
if (e.BarItemKey.EqualsIgnoreCase("LockCell"))
{
this.View.StyleManager.SetEnabled(fieldKey, rowData, null, false);
this.View.ShowMessage("单元格已锁定!");
}
else if (e.BarItemKey.EqualsIgnoreCase("
二开案例.表单插件.锁定解锁单元格
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



