using System; using System.Data; using BP.DA; using BP.En; using BP.WF; using BP.Port; namespace BP.WF.Template { /// /// 任务 属性 /// public class TaskAttr : EntityMyPKAttr { #region 基本属性 /// /// 发起人 /// public const string Starter = "Starter"; /// /// 流程 /// public const string FK_Flow = "FK_Flow"; /// /// 参数 /// public const string Paras = "Paras"; /// /// 任务状态 /// public const string TaskSta = "TaskSta"; /// /// Msg /// public const string Msg = "Msg"; /// /// 发起时间 /// public const string StartDT = "StartDT"; /// /// 插入日期 /// public const string RDT = "RDT"; /// /// 到达节点(可以为0) /// public const string ToNode = "ToNode"; /// /// 到达人员(可以为空) /// public const string ToEmps = "ToEmps"; #endregion } /// /// 任务 /// public class Task : EntityMyPK { #region 属性 /// /// 参数 /// public string Paras { get { return this.GetValStringByKey(TaskAttr.Paras); } set { this.SetValByKey(TaskAttr.Paras, value); } } /// /// 发起人 /// public string Starter { get { return this.GetValStringByKey(TaskAttr.Starter); } set { this.SetValByKey(TaskAttr.Starter, value); } } /// /// 到达的人员 /// public string ToEmps { get { return this.GetValStringByKey(TaskAttr.ToEmps); } set { this.SetValByKey(TaskAttr.ToEmps, value); } } /// /// 到达节点(可以为0) /// public int ToNode { get { return this.GetValIntByKey(TaskAttr.ToNode); } set { this.SetValByKey(TaskAttr.ToNode, value); } } /// /// 流程编号 /// public string FlowNo { get { return this.GetValStringByKey(TaskAttr.FK_Flow); } set { this.SetValByKey(TaskAttr.FK_Flow, value); } } /// /// 发起时间(可以为空) /// public string StartDT { get { return this.GetValStringByKey(TaskAttr.StartDT); } set { this.SetValByKey(TaskAttr.StartDT, value); } } #endregion #region 构造函数 /// /// Task /// public Task() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_Task", "任务"); map.AddMyPK(); //唯一的主键. map.AddTBString(TaskAttr.FK_Flow, null, "流程编号", true, false, 0, 5, 10); map.AddTBString(TaskAttr.Starter, null, "发起人", true, false, 0, 200, 10); //为上海同事科技增加两个字段. 可以为空. map.AddTBInt(TaskAttr.ToNode, 0, "到达的节点", true, false); map.AddTBString(TaskAttr.ToEmps, null, "到达人员", true, false, 0, 200, 10); map.AddTBString(TaskAttr.Paras, null, "参数", true, false, 0, 4000, 10); // TaskSta 0=未发起,1=成功发起,2=发起失败. map.AddTBInt(TaskAttr.TaskSta, 0, "任务状态", true, false); map.AddTBString(TaskAttr.Msg, null, "消息", true, false, 0, 4000, 10); map.AddTBString(TaskAttr.StartDT, null, "发起时间", true, false, 0, 20, 10); map.AddTBString(TaskAttr.RDT, null, "插入数据时间", true, false, 0, 20, 10); this._enMap = map; return this._enMap; } } #endregion } /// /// 任务 /// public class Tasks: EntitiesMyPK { #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new Task(); } } /// /// 任务 /// public Tasks(){} #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((Task)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }