using System; using System.Collections; using BP.DA; using BP.En; namespace BP.Sys { /// /// 框架 /// public class MapFrameAttr : EntityMyPKAttr { /// /// 主表 /// public const string FK_MapData = "FK_MapData"; /// /// URL /// public const string URL = "URL"; public const string FrameURL = "FrameURL"; public const string UrlSrcType = "UrlSrcType"; /// /// 高度 /// public const string H = "H"; /// /// 宽度 /// public const string W = "W"; /// /// 是否可以自适应大小 /// public const string IsAutoSize = "IsAutoSize"; /// /// 名称 /// public const string Name = "Name"; /// /// GUID /// public const string GUID = "GUID"; public const string Y = "Y"; public const string X = "X"; public const string EleType = "EleType"; } /// /// 框架 /// public class MapFrame : EntityMyPK { #region 属性 public override UAC HisUAC { get { UAC uac = new UAC(); if (BP.Web.WebUser.No.Equals("admin")==true) { uac.IsDelete = true; uac.IsUpdate = true; } return uac; } } /// /// 是否自适应大小 /// public bool ItIsAutoSize { get { return this.GetValBooleanByKey(MapFrameAttr.IsAutoSize); } set { this.SetValByKey(MapFrameAttr.IsAutoSize, value); } } /// /// EleType /// public string EleType { get { return this.GetValStrByKey(MapFrameAttr.EleType); } } public void setEleType(string val) { this.SetValByKey(MapFrameAttr.EleType, val); } /// /// 连接 /// public string URL { get { string s= this.GetValStrByKey(MapFrameAttr.FrameURL); if (DataType.IsNullOrEmpty(s)) return "http://ccbpm.cn"; return s; } set { this.SetValByKey(MapFrameAttr.FrameURL, value); } } /// /// 高度 /// public float H { get { return this.GetValFloatByKey(MapFrameAttr.H); } set { this.SetValByKey(MapFrameAttr.H, value); } } /// /// 宽度 /// public float W { get { return this.GetValFloatByKey(MapFrameAttr.W); } set { this.SetValByKey(MapFrameAttr.W, value); } } public bool ItIsUse = false; public string FrmID { get { return this.GetValStrByKey(MapFrameAttr.FK_MapData); } set { this.SetValByKey(MapFrameAttr.FK_MapData, value); } } public string Name { get { return this.GetValStrByKey(MapFrameAttr.Name); } set { this.SetValByKey(MapFrameAttr.Name, value); } } #endregion #region 构造方法 /// /// 框架 /// public MapFrame() { } /// /// 框架 /// /// public MapFrame(string mypk) { this.setMyPK(mypk); this.Retrieve(); } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Sys_MapFrame", "框架"); map.AddMyPK(); map.AddTBString(MapFrameAttr.FK_MapData, null, "表单ID", true, true, 0, 100, 20); map.AddTBString(MapFrameAttr.Name, null, "名称", true, false, 0, 200, 20,true); //@0=自定义@1=地图@2=流程轨迹表@3=流程轨迹图. map.AddTBInt(MapFrameAttr.UrlSrcType, 0, "URL来源", false, false); map.AddTBString(MapFrameAttr.FrameURL, null, "FrameURL", true, false, 0, 3000, 20, true); map.AddTBString(MapFrameAttr.URL, null, "URL", false, false, 0, 3000, 20, true); //map.AddDDLSysEnum(MapFrameAttr.UrlSrcType, 0, "URL来源", true, true, MapFrameAttr.UrlSrcType, //"@0=自定义@1=地图@2=流程轨迹表@3=流程轨迹图"); map.AddTBString(MapFrameAttr.W, null, "宽度", true, false, 0, 20, 20); map.AddTBString(MapFrameAttr.H, null, "高度", true, false, 0, 20, 20); map.AddBoolean(MapFrameAttr.IsAutoSize, true, "是否自动设置大小", false, false); map.AddTBString(MapFrameAttr.EleType, null, "类型", false, false, 0, 50, 20, true); // map.AddTBInt(MapFrameAttr.RowIdx, 99, "位置", false, false); // map.AddTBInt(MapFrameAttr.GroupID, 0, "GroupID", false, false); map.AddTBString(MapFrameAttr.GUID, null, "GUID", false, false, 0, 128, 20); this._enMap = map; return this._enMap; } } /// /// 插入之后增加一个分组. /// protected override void afterInsert() { GroupField gf = new GroupField(); gf.FrmID = this.FrmID; gf.CtrlID = this.MyPK; gf.CtrlType = "Frame"; gf.Lab = this.Name; gf.Idx = 0; gf.Insert(); //插入. base.afterInsert(); } /// /// 删除之后的操作 /// protected override void afterDelete() { GroupField gf = new GroupField(); gf.Delete(GroupFieldAttr.CtrlID, this.MyPK); base.afterDelete(); } protected override bool beforeInsert() { //在属性实体集合插入前,clear父实体的缓存. BP.Sys.Base.Glo.ClearMapDataAutoNum(this.FrmID); return base.beforeInsert(); } protected override bool beforeUpdate() { GroupField gf = new GroupField(); gf.Retrieve(GroupFieldAttr.CtrlID, this.MyPK); gf.Lab = this.Name; gf.Update(); return base.beforeUpdate(); } #endregion } /// /// 框架s /// public class MapFrames : EntitiesMyPK { #region 构造 /// /// 框架s /// public MapFrames() { } /// /// 框架s /// /// s public MapFrames(string fk_mapdata) { this.Retrieve(MapFrameAttr.FK_MapData, fk_mapdata); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new MapFrame(); } } #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((MapFrame)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }