using System; using System.Data; using BP.DA; using BP.Sys; using BP.En; using System.Collections; using BP.Port; using BP.WF.Data; using BP.WF.Template; using BP.WF.Port; using System.Collections.Generic; namespace BP.WF.Template { /// /// 这里存放每个节点的信息. /// public class NodeSimple : Entity { #region 节点属性. /// /// 节点编号 /// public int NodeID { get { return this.GetValIntByKey(NodeAttr.NodeID); } set { this.SetValByKey(NodeAttr.NodeID, value); } } public DeliveryWay HisDeliveryWay { get { return (DeliveryWay)this.GetValIntByKey(NodeAttr.DeliveryWay); } set { this.SetValByKey(NodeAttr.DeliveryWay, value); } } public string DeliveryParas { get { return this.GetValStringByKey(NodeAttr.DeliveryParas); } } public string Name { get { return this.GetValStringByKey(NodeAttr.Name); } set { this.SetValByKey(NodeAttr.Name, value); } } public float X { get { return this.GetValFloatByKey(NodeAttr.X); } set { this.SetValByKey(NodeAttr.X, value); } } /// /// y /// public float Y { get { return this.GetValFloatByKey(NodeAttr.Y); } set { this.SetValByKey(NodeAttr.Y, value); } } public string HisToNDs { get { return this.GetValStrByKey(NodeAttr.HisToNDs); } set { this.SetValByKey(NodeAttr.HisToNDs, value); } } public bool IsResetAccepter { get { return this.GetValBooleanByKey(NodeAttr.IsResetAccepter); } } #endregion 节点属性. #region 构造函数 /// /// 节点 /// public NodeSimple() { } /// /// 节点 /// /// 节点ID public NodeSimple(int nodeID) { this.NodeID = nodeID; this.Retrieve(); } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_Node", "节点"); map.DepositaryOfEntity= Depositary.Application; map.DepositaryOfMap = Depositary.Application; #region 基本属性. map.AddTBIntPK(NodeAttr.NodeID, 0, "节点ID", true, true); map.AddTBString(NodeAttr.Name, null, "名称", true, false, 0, 150, 10); map.AddTBString(NodeAttr.FK_Flow, null, "流程编号", true, false, 0, 5, 10); map.AddTBInt(NodeAttr.RunModel, 0, "运行模式", true, true); map.AddTBInt(NodeAttr.DeliveryWay, 0, "运行模式", true, true); map.AddTBString(NodeAttr.DeliveryParas, null, "参数", true, false, 0, 300, 10); map.AddTBString(NodeAttr.HisToNDs, null, "转到的节点", false, false, 0, 50, 10); map.AddBoolean(NodeAttr.IsResetAccepter, false, "可逆节点时重新计算接收人?", true, true, true); map.AddTBInt(NodeAttr.Step, 0, "步骤", true, true); #endregion 基本属性. map.AddTBInt(NodeAttr.X, 0, "X坐标", false, false); map.AddTBInt(NodeAttr.Y, 0, "Y坐标", false, false); map.AddTBAtParas(500); this._enMap = map; return this._enMap; } } #endregion } /// /// 节点集合 /// public class NodeSimples : Entities { #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new NodeSimple(); } } #endregion #region 构造方法 /// /// 节点集合 /// public NodeSimples() { } /// /// 节点集合. /// /// public NodeSimples(string fk_flow) { this.Retrieve(NodeAttr.FK_Flow, fk_flow, NodeAttr.Step); } #endregion #region 为了适应自动翻译成java的需要,把实体转换成List. /// /// 转化成 java list,C#不能调用. /// /// List public System.Collections.Generic.IList ToJavaList() { return (System.Collections.Generic.IList)this; } /// /// 转化成list 为了翻译成java的需要 /// /// List public List Tolist() { List list = new List(); for (int i = 0; i < this.Count; i++) { list.Add((BP.WF.Template.NodeSimple)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }