using System; using System.Collections; using BP.DA; using BP.En; using BP.En; using BP.WF.Port; using BP.Port; //using BP.ZHZS.Base; namespace BP.WF.Template { /// /// 抄送到岗位 属性 /// public class CCStationAttr { /// /// 节点 /// public const string FK_Node = "FK_Node"; /// /// 工作岗位 /// public const string FK_Station = "FK_Station"; } /// /// 抄送到岗位 /// 节点的工作岗位有两部分组成. /// 记录了从一个节点到其他的多个节点. /// 也记录了到这个节点的其他的节点. /// public class CCStation : EntityMM { #region 基本属性 /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenAll(); return uac; } } /// ///节点 /// public int FK_Node { get { return this.GetValIntByKey(CCStationAttr.FK_Node); } set { this.SetValByKey(CCStationAttr.FK_Node, value); } } /// /// 岗位名称 /// public string FK_StationT { get { return this.GetValRefTextByKey(CCStationAttr.FK_Station); } } /// /// 工作岗位 /// public string FK_Station { get { return this.GetValStringByKey(CCStationAttr.FK_Station); } set { this.SetValByKey(CCStationAttr.FK_Station, value); } } #endregion #region 构造方法 /// /// 抄送到岗位 /// public CCStation() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_CCStation", "抄送岗位"); map.AddDDLEntitiesPK(CCStationAttr.FK_Node, 0, DataType.AppInt, "节点", new Nodes(), NodeAttr.NodeID, NodeAttr.Name, true); map.AddDDLEntitiesPK(CCStationAttr.FK_Station, null, "工作岗位", new Stations(), true); this._enMap = map; return this._enMap; } } #endregion } /// /// 抄送到岗位 /// public class CCStations : EntitiesMM { /// /// 他的工作岗位 /// public Stations HisStations { get { Stations ens = new Stations(); foreach (CCStation ns in this) { ens.AddEntity(new Station(ns.FK_Station)); } return ens; } } /// /// 他的工作节点 /// public Nodes HisNodes { get { Nodes ens = new Nodes(); foreach (CCStation ns in this) { ens.AddEntity(new Node(ns.FK_Node)); } return ens; } } /// /// 抄送到岗位 /// public CCStations() { } /// /// 抄送到岗位 /// /// 节点ID public CCStations(int nodeID) { QueryObject qo = new QueryObject(this); qo.AddWhere(CCStationAttr.FK_Node, nodeID); qo.DoQuery(); } /// /// 抄送到岗位 /// /// StationNo public CCStations(string StationNo) { QueryObject qo = new QueryObject(this); qo.AddWhere(CCStationAttr.FK_Station, StationNo); qo.DoQuery(); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new CCStation(); } } /// /// 工作岗位对应的节点 /// /// 工作岗位编号 /// 节点s public Nodes GetHisNodes(string stationNo) { QueryObject qo = new QueryObject(this); qo.AddWhere(CCStationAttr.FK_Station, stationNo); qo.DoQuery(); Nodes ens = new Nodes(); foreach (CCStation en in this) { ens.AddEntity(new Node(en.FK_Node)); } return ens; } /// /// 转向此节点的集合的Nodes /// /// 此节点的ID /// 转向此节点的集合的Nodes (FromNodes) public Stations GetHisStations(int nodeID) { QueryObject qo = new QueryObject(this); qo.AddWhere(CCStationAttr.FK_Node, nodeID); qo.DoQuery(); Stations ens = new Stations(); foreach (CCStation en in this) { ens.AddEntity(new Station(en.FK_Station)); } return ens; } #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((CCStation)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }