using System; using System.Collections; using BP.DA; using BP.En; using BP.WF.Template; using BP.WF; using BP.Sys; namespace BP.WF.Template { /// /// 轨迹图标组件控件状态 /// public enum FrmTrackSta { /// /// 不可用 /// Disable, /// /// 显示轨迹图 /// Chart, /// /// 显示轨迹表 /// Table } /// /// 轨迹图标组件 /// public class FrmTrackAttr : EntityNoNameAttr { /// /// 显示标签 /// public const string FrmTrackLab = "FrmTrackLab"; /// /// 状态 /// public const string FrmTrackSta = "FrmTrackSta"; /// /// H /// public const string FrmTrack_H = "FrmTrack_H"; } /// /// 轨迹图标组件 /// public class FrmTrack : Entity { #region 属性 public string No { get { return "ND" + this.NodeID; } set { string nodeID = value.Replace("ND", ""); this.NodeID = int.Parse(nodeID); } } /// /// 节点ID /// public int NodeID { get { return this.GetValIntByKey(NodeAttr.NodeID); } set { this.SetValByKey(NodeAttr.NodeID, value); } } /// /// 控件状态 /// public FrmTrackSta FrmTrackSta { get { return (FrmTrackSta)this.GetValIntByKey(FrmTrackAttr.FrmTrackSta); } set { this.SetValByKey(FrmTrackAttr.FrmTrackSta, (int)value); } } /// /// H /// public float FrmTrack_H { get { return this.GetValFloatByKey(FrmTrackAttr.FrmTrack_H); } set { this.SetValByKey(FrmTrackAttr.FrmTrack_H, value); } } public string FrmTrack_Hstr { get { if (this.FrmTrack_H == 0) return "100%"; return this.FrmTrack_H + "px"; } } /// /// 节点名称. /// public string Name { get { return this.GetValStringByKey("Name"); } } /// /// 显示标签 /// public string FrmTrackLab { get { return this.GetValStrByKey(FrmTrackAttr.FrmTrackLab); } } #endregion #region 构造方法 /// /// 控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenForSysAdmin(); uac.IsDelete = false; uac.IsInsert = false; return uac; } } /// /// 重写主键 /// public override string PK { get { return "NodeID"; } } /// /// 轨迹图标组件 /// public FrmTrack() { } /// /// 轨迹图标组件 /// /// public FrmTrack(string mapData) { if (mapData.Contains("ND") == false) { this.FrmTrackSta = FrmTrackSta.Disable; return; } string mapdata = mapData.Replace("ND", ""); if (DataType.IsNumStr(mapdata) == false) { this.FrmTrackSta = FrmTrackSta.Disable; return; } try { this.NodeID = int.Parse(mapdata); } catch { return; } this.Retrieve(); } /// /// 轨迹图标组件 /// /// public FrmTrack(int nodeID) { this.NodeID = nodeID; this.Retrieve(); } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_Node", "轨迹图标组件"); map.AddGroupAttr("轨迹组件"); map.AddTBIntPK(NodeAttr.NodeID, 0, "节点ID", true, true); map.AddTBString(NodeAttr.Name, null, "节点名称", true, true, 0, 100, 10); map.AddTBString(FrmTrackAttr.FrmTrackLab, "轨迹", "显示标签", true, false, 0, 200, 10, false); #region 此处变更了 NodeSheet类中的,map 描述该部分也要变更. map.AddDDLSysEnum(FrmTrackAttr.FrmTrackSta, (int)FrmTrackSta.Disable, "组件状态", true, true, FrmTrackAttr.FrmTrackSta, "@0=禁用@1=显示轨迹图@2=显示轨迹表"); map.AddTBFloat(FrmTrackAttr.FrmTrack_H, 300, "高度", true, false); #endregion 此处变更了 NodeSheet类中的,map 描述该部分也要变更. this._enMap = map; return this._enMap; } } protected override bool beforeUpdateInsertAction() { return base.beforeUpdateInsertAction(); } #endregion } /// /// 轨迹图标组件s /// public class FrmTracks : Entities { #region 构造 /// /// 轨迹图标组件s /// public FrmTracks() { } /// /// 轨迹图标组件s /// /// s public FrmTracks(string fk_mapdata) { if (BP.Difference.SystemConfig.IsDebug) this.Retrieve("No", fk_mapdata); else this.RetrieveFromCash("No", (object)fk_mapdata); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new FrmTrack(); } } #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((FrmTrack)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }