using BP.DA;
using BP.En;
using BP.Port;
namespace BP.WF.Template.CCEn
{
///
/// 抄送到角色 属性
///
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.
}
}