using System; using System.Data; using BP.DA; using BP.En; using BP.WF; using BP.Port; using BP.En; namespace BP.WF { /// /// 记忆我 属性 /// public class RememberMeAttr { #region 基本属性 /// /// 工作节点 /// public const string FK_Emp = "FK_Emp"; /// /// 当前节点 /// public const string FK_Node = "FK_Node"; /// /// 可执行人员 /// public const string Objs = "Objs"; /// /// 可执行人员 /// public const string ObjsExt = "ObjsExt"; /// /// 可执行人员数据量 /// public const string NumOfObjs = "NumOfObjs"; /// /// 工作人员(候选) /// public const string Emps = "Emps"; /// /// 工作人员个数(候选) /// public const string NumOfEmps = "NumOfEmps"; /// /// 工作人员(候选) /// public const string EmpsExt = "EmpsExt"; #endregion } /// /// 记忆我 /// public class RememberMe : EntityMyPK { #region 属性 /// /// 操作员 /// public string EmpNo { get { return this.GetValStringByKey(RememberMeAttr.FK_Emp); } set { this.SetValByKey(RememberMeAttr.FK_Emp, value); this.setMyPK(this.NodeID + "_" + BP.Web.WebUser.No); } } /// /// 当前节点 /// public int NodeID { get { return this.GetValIntByKey(RememberMeAttr.FK_Node); } set { this.SetValByKey(RememberMeAttr.FK_Node, value); this.setMyPK(this.NodeID + "_" + BP.Web.WebUser.No); } } /// /// 有效的工作人员 /// public string Objs { get { return this.GetValStringByKey(RememberMeAttr.Objs); } set { this.SetValByKey(RememberMeAttr.Objs, value); } } /// /// 有效的操作人员ext /// public string ObjsExt { get { return this.GetValStringByKey(RememberMeAttr.ObjsExt); } set { this.SetValByKey(RememberMeAttr.ObjsExt, value); } } /// /// 所有的人员数量. /// public int NumOfEmps { get { return this.Emps.Split('@').Length - 2; } } /// /// 可以处理的人员数量 /// public int NumOfObjs { get { return this.Objs.Split('@').Length - 2; } } /// /// 所有的工作人员 /// public string Emps { get { return this.GetValStringByKey(RememberMeAttr.Emps); } set { this.SetValByKey(RememberMeAttr.Emps, value); } } /// /// 所有的工作人员ext /// public string EmpsExt { get { string str = this.GetValStringByKey(RememberMeAttr.EmpsExt).Trim(); if (str.Length == 0) return str; if (str.Substring(str.Length - 1) == "、") return str.Substring(0, str.Length - 1); else return str; } set { this.SetValByKey(RememberMeAttr.EmpsExt, value); } } #endregion #region 构造函数 /// /// RememberMe /// public RememberMe() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_RememberMe", "记忆我"); map.AddMyPK(); map.AddTBInt(RememberMeAttr.FK_Node, 0, "节点", false, false); map.AddTBString(RememberMeAttr.FK_Emp, "", "当前操作人员", true, false, 1, 30, 10); map.AddTBString(RememberMeAttr.Objs, "", "分配人员", true, false, 0, 4000, 10); map.AddTBString(RememberMeAttr.ObjsExt, "", "分配人员Ext", true, false, 0, 4000, 10); map.AddTBString(RememberMeAttr.Emps, "", "所有的工作人员", true, false, 0, 4000, 10); map.AddTBString(RememberMeAttr.EmpsExt, "", "工作人员Ext", true, false, 0, 4000, 10); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeUpdateInsertAction() { this.EmpNo = BP.Web.WebUser.No; this.setMyPK(this.NodeID + "_" + this.EmpNo); return base.beforeUpdateInsertAction(); } } /// /// 记忆我 /// public class RememberMes: Entities { #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new RememberMe(); } } /// /// RememberMe /// public RememberMes(){} #endregion #region 为了适应自动翻译成java的需要,把实体转换成List. /// /// 转化成 java list,C#不能调用. /// /// List public System.Collections.Generic.IList ToJavaList() { return (System.Collections.Generic.IList)this; } /// /// 转化成list /// /// List public System.Collections.Generic.List Tolist() { System.Collections.Generic.List list = new System.Collections.Generic.List(); for (int i = 0; i < this.Count; i++) { list.Add((RememberMe)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }