using System; using BP.En; namespace BP.WF.Data { public class CHNodeAttr { #region 属性 public const string MyPK = "MyPK"; /// /// 工作ID /// public const string WorkID = "WorkID"; /// /// 节点 /// public const string FK_Node = "FK_Node"; /// /// 节点名称 /// public const string NodeName = "NodeName"; /// /// 计划开始时间 /// public const string StartDT = "StartDT"; /// /// 计划结束时间 /// public const string EndDT = "EndDT"; /// /// 工天 /// public const string GT = "GT"; /// /// 阶段占比 /// public const string Scale = "Scale"; /// /// 总进度 /// public const string TotalScale = "TotalScale"; /// /// 产值 /// public const string ChanZhi = "ChanZhi"; #endregion 属性 } /// /// 节点时限 /// public class CHNode : EntityMyPK { #region 基本属性 /// /// 工作ID /// public Int64 WorkID { get { return this.GetValInt64ByKey(CHAttr.WorkID); } set { this.SetValByKey(CHAttr.WorkID, value); } } /// /// 节点ID /// public int FK_Node { get { return this.GetValIntByKey(CHAttr.FK_Node); } set { this.SetValByKey(CHAttr.FK_Node, value); } } /// /// 节点名称 /// public string NodeName { get { return this.GetValStrByKey(CHNodeAttr.NodeName); } set { this.SetValByKey(CHNodeAttr.NodeName, value); } } /// /// 操作人员 /// public string FK_Emp { get { return this.GetValStringByKey(CHAttr.FK_Emp); } set { this.SetValByKey(CHAttr.FK_Emp, value); } } /// /// 人员 /// public string FK_EmpT { get { return this.GetValStringByKey(CHAttr.FK_EmpT); } set { this.SetValByKey(CHAttr.FK_EmpT, value); } } /// /// 计划开始时间 /// public string StartDT { get { return this.GetValStringByKey(CHNodeAttr.StartDT); } set { this.SetValByKey(CHNodeAttr.StartDT, value); } } /// /// 计划完成时间 /// public string EndDT { get { return this.GetValStringByKey(CHNodeAttr.EndDT); } set { this.SetValByKey(CHNodeAttr.EndDT, value); } } /// /// 工天 /// public int GT { get { return this.GetValIntByKey(CHNodeAttr.GT); } set { this.SetValByKey(CHNodeAttr.GT, value); } } /// /// 阶段占比 /// public float Scale { get { return this.GetValFloatByKey(CHNodeAttr.Scale); } set { this.SetValByKey(CHNodeAttr.Scale, value); } } /// /// 总体进度 /// public float TotalScale { get { return this.GetValFloatByKey(CHNodeAttr.TotalScale); } set { this.SetValByKey(CHNodeAttr.TotalScale, value); } } /// /// 产值 /// public float ChanZhi { get { return this.GetValFloatByKey(CHNodeAttr.ChanZhi); } set { this.SetValByKey(CHNodeAttr.ChanZhi, value); } } #endregion #region 构造方法 /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.IsDelete = false; uac.IsInsert = false; uac.IsUpdate = false; uac.IsView = true; return uac; } } /// /// 节点时限 /// public CHNode() { } /// /// /// /// public CHNode(string pk) : base(pk) { } #endregion #region Map /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_CHNode", "节点时限"); map.AddTBInt(CHNodeAttr.WorkID, 0, "WorkID", true, true); map.AddTBInt(CHNodeAttr.FK_Node, 0, "节点", true, true); map.AddTBString(CHNodeAttr.NodeName, null, "节点名称", true, true, 0, 50, 5); map.AddTBString(CHAttr.FK_Emp, null, "处理人", true, true, 0, 100, 3); map.AddTBString(CHAttr.FK_EmpT, null, "处理人名称", true, true, 0, 200, 5); map.AddTBString(CHNodeAttr.StartDT, null, "计划开始时间", true, true, 0, 50, 5); map.AddTBString(CHNodeAttr.EndDT, null, "计划结束时间", true, true, 0, 50, 5); map.AddTBInt(CHNodeAttr.GT, 0, "工天", true, true); map.AddTBFloat(CHNodeAttr.Scale, 0, "阶段占比", true, true); map.AddTBFloat(CHNodeAttr.TotalScale, 0, "总进度", true, true); map.AddTBFloat(CHNodeAttr.ChanZhi, 0, "产值", true, true); map.AddTBAtParas(500); map.AddTBStringPK(CHNodeAttr.MyPK, null, "MyPK", false, false, 0, 50, 5); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeUpdateInsertAction() { this.setMyPK(this.WorkID + "_" + this.FK_Node); return base.beforeUpdateInsertAction(); } } /// /// 节点时限s /// public class CHNodes :Entities { #region 构造方法属性 /// /// 节点时限s /// public CHNodes(){} public CHNodes(Int64 WorkID) { this.Retrieve(CHNodeAttr.WorkID, WorkID); return; } #endregion #region 属性 /// /// 节点时限 /// public override Entity GetNewEntity { get { return new CHNode(); } } #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((CHNode)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }