using System; using System.Collections; using BP.DA; using BP.En; using BP.En; using BP.WF.Port; namespace BP.WF.Template { /// /// 节点工作角色属性 /// public class NodeStationAttr { /// /// 节点 /// public const string FK_Node = "FK_Node"; /// /// 工作角色 /// public const string FK_Station = "FK_Station"; } /// /// 节点工作角色 /// public class NodeStation : EntityMyPK { #region 基本属性 /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenAll(); return uac; } } /// ///节点 /// public int FK_Node { get { return this.GetValIntByKey(NodeStationAttr.FK_Node); } set { this.SetValByKey(NodeStationAttr.FK_Node, value); } } public string FK_StationT { get { return this.GetValRefTextByKey(NodeStationAttr.FK_Station); } } /// /// 工作角色 /// public string FK_Station { get { return this.GetValStringByKey(NodeStationAttr.FK_Station); } set { this.SetValByKey(NodeStationAttr.FK_Station, value); } } #endregion #region 构造方法 /// /// 节点工作角色 /// public NodeStation() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_NodeStation", "节点角色"); map.AddMyPK(); map.AddTBInt(NodeStationAttr.FK_Node, 0, "节点", false, false); map.AddDDLEntities(NodeStationAttr.FK_Station, null, "工作角色", new BP.Port.Stations(), true); //map.AddTBIntPK(NodeStationAttr.FK_Node, 0, "节点", false, false); //// #warning ,这里为了方便用户选择,让分组都统一采用了枚举类型. edit zhoupeng. 2015.04.28. 注意jflow也要修改. //map.AddDDLEntitiesPK(NodeStationAttr.FK_Station, null, "工作角色", // new BP.Port.Stations(), true); this._enMap = map; return this._enMap; } } protected override bool beforeUpdateInsertAction() { this.setMyPK(this.FK_Node + "_" + this.FK_Station); return base.beforeUpdateInsertAction(); } /// /// 节点角色发生变化,删除该节点记忆的接收人员。 /// /// protected override bool beforeInsert() { RememberMe remeberMe = new RememberMe(); remeberMe.Delete(RememberMeAttr.FK_Node, this.FK_Node); return base.beforeInsert(); } #endregion } /// /// 节点工作角色s /// public class NodeStations : EntitiesMyPK { #region 构造函数. /// /// 节点工作角色 /// public NodeStations() { } /// /// 节点工作角色 /// /// 节点ID public NodeStations(int nodeID) { QueryObject qo = new QueryObject(this); qo.AddWhere(NodeStationAttr.FK_Node, nodeID); qo.DoQuery(); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new NodeStation(); } } #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((NodeStation)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }