using System; using System.Collections; using BP.DA; using BP.En; using BP.Sys; namespace BP.Sys.FrmUI { /// /// 装饰图片 /// public class ExtImg : EntityMyPK { #region 构造方法 /// /// 控制权限 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.IsInsert = false; uac.IsUpdate = true; uac.IsDelete = true; return uac; } } /// /// 装饰图片 /// public ExtImg() { } /// /// 装饰图片 /// /// public ExtImg(string mypk) { this.setMyPK(mypk); this.Retrieve(); } public string KeyOfEn { get { return this.GetValStringByKey(MapAttrAttr.KeyOfEn); } set { this.SetValByKey(MapAttrAttr.KeyOfEn, value); } } public string FK_MapData { get { return this.GetValStringByKey(MapAttrAttr.FK_MapData); } set { this.SetValByKey(MapAttrAttr.FK_MapData, value); } } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Sys_FrmImg", "装饰图片"); map.IndexField = MapAttrAttr.FK_MapData; map.AddMyPK(); map.AddTBString(MapAttrAttr.FK_MapData, null, "表单ID", true, true, 0, 200, 20); map.AddTBString(MapAttrAttr.KeyOfEn, null, "对应字段", true, true, 0, 200, 20); map.AddTBString(FrmImgAttr.Name, null, "中文名称", true, true, 0, 500, 20); map.AddDDLSysEnum(FrmImgAttr.ImgSrcType, 0, "图片来源", true, true, FrmImgAttr.ImgSrcType, "@0=本地@1=URL"); map.AddTBString(FrmImgAttr.ImgPath, null, "图片路径", true, false, 0, 200, 20, true); string strs = "本机的图片路径:"; strs += " \n 1.您可以使用 @baseBase 或者@+字段英文名作为变量来标识文件路径."; strs += " \n 2.注意@需要半角字符."; strs += " \n 3.例如:@basePath/DataUser/UserIcon/@QingJiaRenID.png"; map.SetHelperAlert(FrmImgAttr.ImgPath, strs); map.AddTBString(FrmImgAttr.ImgURL, null, "图片URL", true, false, 0, 200, 20, true); map.AddTBString(FrmImgAttr.LinkURL, null, "连接到URL", true, false, 0, 200, 20, true); map.AddTBString(FrmImgAttr.LinkTarget, "_blank", "连接目标", true, false, 0, 200, 20); //UIContralType.FrmImg //map.AddTBString(FrmImgAttr.Tag0, null, "参数", true, false, 0, 500, 20); 2 //map.AddTBString(FrmImgAttr.EnPK, null, "英文名称", true, false, 0, 500, 20); //map.AddTBInt(FrmImgAttr.ImgAppType, 0, "应用类型", false, false); //map.AddTBString(FrmImgAttr.GUID, null, "GUID", true, false, 0, 128, 20); map.AddTBInt(FrmImgAttr.ImgAppType, 0, "应用类型", false, false); //显示的分组. map.AddDDLSQL(MapAttrAttr.GroupID,0, "显示的分组", MapAttrString.SQLOfGroupAttr, true); map.AddTBInt(MapAttrAttr.ColSpan, 0, "单元格数量", false, true); //跨单元格 map.AddDDLSysEnum(MapAttrAttr.LabelColSpan, 1, "文本单元格数量", true, true, "ColSpanAttrString", "@1=跨1个单元格@2=跨2个单元格@3=跨3个单元格@4=跨4个单元格"); //跨行 map.AddDDLSysEnum(MapAttrAttr.RowSpan, 1, "行数", true, true, "RowSpanAttrString", "@1=跨1个行@2=跨2行@3=跨3行"); map.AddTBFloat(MapAttrAttr.UIWidth, 0, "宽度", true, false); map.AddTBFloat(MapAttrAttr.UIHeight, 0, "高度", true, false); this._enMap = map; return this._enMap; } } protected override void afterInsertUpdateAction() { //在属性实体集合插入前,clear父实体的缓存. BP.Sys.Base.Glo.ClearMapDataAutoNum(this.FK_MapData); BP.Sys.FrmImg imgAth = new BP.Sys.FrmImg(); imgAth.setMyPK(this.MyPK); imgAth.RetrieveFromDBSources(); imgAth.Update(); //同步更新MapAttr if (DataType.IsNullOrEmpty(this.KeyOfEn) == false) { MapAttrString attr = new MapAttrString(this.MyPK); attr.SetValByKey(MapAttrAttr.ColSpan, this.GetValStrByKey(MapAttrAttr.ColSpan)); attr.SetValByKey(MapAttrAttr.LabelColSpan, this.GetValStrByKey(MapAttrAttr.LabelColSpan)); attr.SetValByKey(MapAttrAttr.RowSpan, this.GetValStrByKey(MapAttrAttr.RowSpan)); attr.SetValByKey(MapAttrAttr.Name, this.GetValStrByKey(FrmImgAttr.Name)); //名称. attr.SetValByKey(MapAttrAttr.UIWidth, this.GetValStrByKey(MapAttrAttr.UIWidth)); attr.SetValByKey(MapAttrAttr.UIHeight, this.GetValStrByKey(MapAttrAttr.UIHeight)); attr.Update(); } base.afterInsertUpdateAction(); } protected override void afterDelete() { //把相关的字段也要删除. MapAttrString attr = new MapAttrString(); attr.setMyPK(this.MyPK); attr.setFK_MapData(this.FK_MapData); attr.Delete(); base.afterDelete(); } #endregion } /// /// 装饰图片s /// public class ExtImgs : EntitiesMyPK { #region 构造 /// /// 装饰图片s /// public ExtImgs() { } /// /// 装饰图片s /// /// s public ExtImgs(string fk_mapdata) { if (BP.Difference.SystemConfig.IsDebug) this.Retrieve(MapAttrAttr.FK_MapData, fk_mapdata); else this.RetrieveFromCash(MapAttrAttr.FK_MapData, (object)fk_mapdata); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new FrmImg(); } } #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((ExtImg)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }