二开案例.列表插件.列表条件格式化之按用户进行格式化

【应用场景】按用户进行列表条件格式化。
【案例演示】采购订单列表,不同用户查看时,显示不同的前景色。
【实现步骤】
<1>编写列表插件,如下所示。
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.List.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Util;
using System.ComponentModel;
namespace Jac.XkDemo.BOS.Business.PlugIn
{
/// <summary>
/// 【列表插件】列表条件格式化之按用户进行格式化
/// </summary>
[HotUpdate]
[Description("【列表插件】列表条件格式化之按用户进行格式化")]
public class FormatRowByUserListPlugIn : AbstractListPlugIn
{
/// <summary>
/// 列表行数据格式化
/// </summary>
/// <param name="args"></param>
public override void OnFormatRowConditions(ListFormatConditionArgs args)
{
base.OnFormatRowConditions(args);
if (this.Context.UserName == "demo")
{
var fc = new FormatCondition();
fc.ApplayRow = true;// 格式化整行
fc.ForeColor = "#FF0000";
args.FormatConditions.Add(fc);
}
else if (this.Context.UserName == "张三")
{
var fc = new FormatCondition();
fc.ApplayRow = true;
fc.ForeColor = "#00FF00";
args.FormatConditions.Add(fc);
}
else if (this.Context.UserName == "李四")
{
var fc = new FormatCondition();
fc.ApplayRow = true
二开案例.列表插件.列表条件格式化之按用户进行格式化
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



