using System; using System.Collections; using BP.DA; using BP.En; using BP.Sys; namespace BP.Sys.FrmUI { /// /// 框架 /// public class MapFrameExt : EntityMyPK { #region 属性 /// /// 连接 /// public string FK_MapData { get { return this.GetValStrByKey(MapFrameAttr.FK_MapData); } } public string Name { get { return this.GetValStrByKey(MapFrameAttr.Name); } } #endregion #region 构造方法 /// /// 权限控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); //if (BP.Web.WebUser.No.Equals("admin")) //{ uac.IsUpdate = true; uac.IsDelete = true; uac.IsInsert = false; //} return uac; } } /// /// 框架 /// public MapFrameExt() { } /// /// 框架 /// /// public MapFrameExt(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); map.AddDDLSysEnum(MapFrameAttr.UrlSrcType, 0, "URL来源", true, true, MapFrameAttr.UrlSrcType, "@0=自定义@1=地图@2=流程轨迹表@3=流程轨迹图"); map.AddTBString(MapFrameAttr.FrameURL, null, "URL", true, false, 0, 3000, 20, true); map.AddTBString(MapFrameAttr.URL, null, "URL", false, false, 0, 3000, 20, true); //显示的分组. // map.AddDDLSQL(MapFrameAttr.FrmID, "0", "表单表单","SELECT No, Name FROM Sys_Mapdata WHERE FrmType=3 ", true); 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.AddTBString(MapFrameAttr.GUID, null, "GUID", false, false, 0, 128, 20); map.AddTBInt(MapAttrAttr.Idx, 0, "顺序号", true, false); //@李国文. #region 执行的方法. RefMethod rm = new RefMethod(); rm = new RefMethod(); rm.Title = "预制"; rm.ClassMethodName = this.ToString() + ".DoFrameExt()"; rm.RefMethodType = RefMethodType.RightFrameOpen; map.AddRefMethod(rm); #endregion 执行的方法. this._enMap = map; return this._enMap; } } #endregion #region 框架扩展. /// /// 框架扩展 /// /// public string DoFrameExt() { return "../../Admin/FoolFormDesigner/FrameExt/Default.htm?MyPK=" + this.MyPK; } #endregion 框架扩展. protected override void afterDelete() { //删除分组信息. GroupField gf = new GroupField(); gf.Delete(GroupFieldAttr.CtrlID, this.MyPK); //调用frmEditAction, 完成其他的操作. BP.Sys.CCFormAPI.AfterFrmEditAction(this.FK_MapData); base.afterDelete(); } protected override bool beforeUpdateInsertAction() { //在属性实体集合插入前,clear父实体的缓存. BP.Sys.Base.Glo.ClearMapDataAutoNum(this.FK_MapData); int val = this.GetValIntByKey(MapFrameAttr.UrlSrcType, 0); if (val == 1) { string sql = "SELECT Url FROM Sys_MapData WHERE No='" + this.GetValStrByKey(MapFrameAttr.FrmID) + "'"; string url = DBAccess.RunSQLReturnStringIsNull(sql, ""); this.SetValByKey(MapFrameAttr.FrameURL, url); this.SetValByKey(MapFrameAttr.URL, url); } else { this.SetValByKey(MapFrameAttr.URL, this.GetValByKey(MapFrameAttr.FrameURL)); } //更新group. GroupField gf = new GroupField(); int i = gf.Retrieve(GroupFieldAttr.FrmID, this.FK_MapData, GroupFieldAttr.CtrlID, this.MyPK); if (i == 1) { gf.Lab = this.Name; gf.Update(); } return base.beforeUpdateInsertAction(); } protected override void afterInsertUpdateAction() { MapFrame mapframe = new MapFrame(); mapframe.setMyPK(this.MyPK); mapframe.RetrieveFromDBSources(); mapframe.Update(); //调用frmEditAction, 完成其他的操作. BP.Sys.CCFormAPI.AfterFrmEditAction(this.FK_MapData); base.afterInsertUpdateAction(); } } /// /// 框架s /// public class MapFrameExts : EntitiesMyPK { #region 构造 /// /// 框架s /// public MapFrameExts() { } /// /// 框架s /// /// 表单ID public MapFrameExts(string frmID) { this.Retrieve(MapFrameAttr.FK_MapData, frmID); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new MapFrameExt(); } } #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((MapFrameExt)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }