using System;
using System.Collections;
using BP.DA;
using BP.En;
using BP.En;
using BP.WF.Port;
namespace BP.WF.Template
{
///
/// 节点人员属性
///
public class NodeEmpAttr
{
///
/// 节点
///
public const string FK_Node="FK_Node";
///
/// 人员
///
public const string FK_Emp="FK_Emp";
}
///
/// 节点人员
/// 节点的到人员有两部分组成.
/// 记录了从一个节点到其他的多个节点.
/// 也记录了到这个节点的其他的节点.
///
public class NodeEmp :EntityMyPK
{
#region 基本属性
///
///节点
///
public int NodeID
{
get
{
return this.GetValIntByKey(NodeEmpAttr.FK_Node);
}
set
{
this.SetValByKey(NodeEmpAttr.FK_Node,value);
}
}
///
/// 到人员
///
public string EmpNo
{
get
{
return this.GetValStringByKey(NodeEmpAttr.FK_Emp);
}
set
{
this.SetValByKey(NodeEmpAttr.FK_Emp,value);
}
}
public string EmpName
{
get
{
return this.GetValRefTextByKey(NodeEmpAttr.FK_Emp);
}
}
#endregion
#region 构造方法
///
/// 节点人员
///
public NodeEmp()
{
}
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("WF_NodeEmp", "节点人员");
map.IndexField = NodeEmpAttr.FK_Node;
map.AddMyPK();
map.AddTBInt(NodeEmpAttr.FK_Node, 0, "节点ID", true, true);
map.AddDDLEntities(NodeEmpAttr.FK_Emp, null, "到人员", new BP.Port.Emps(), true);
//map.AddTBIntPK(NodeEmpAttr.FK_Node,0,"Node",true,true);
//map.AddDDLEntitiesPK(NodeEmpAttr.FK_Emp, null, "到人员", new BP.Port.Emps(), true);
this._enMap = map;
return this._enMap;
}
}
#endregion
protected override bool beforeUpdateInsertAction()
{
this.setMyPK(this.NodeID + "_" + this.EmpNo);
return base.beforeUpdateInsertAction();
}
protected override bool beforeInsert()
{
if (BP.Difference.SystemConfig.CCBPMRunModel == BP.Sys.CCBPMRunModel.SAAS)
this.EmpNo = Web.WebUser.OrgNo + "_" + this.EmpNo;
return base.beforeInsert();
}
}
///
/// 节点人员
///
public class NodeEmps : EntitiesMyPK
{
///
/// 节点人员
///
public NodeEmps() { }
///
/// 节点人员
///
/// 节点ID
public NodeEmps(int NodeID)
{
QueryObject qo = new QueryObject(this);
qo.AddWhere(NodeEmpAttr.FK_Node, NodeID);
qo.DoQuery();
}
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new NodeEmp();
}
}
#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((NodeEmp)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}