using System; using System.Collections; using BP.DA; using BP.En; namespace BP.Sys { /// /// 图片附件 属性 /// public class FrmImgAthAttr : EntityMyPKAttr { /// /// 名称 /// public const string Name = "Name"; /// /// 主表 /// public const string FrmID = "FK_MapData"; /// /// X /// public const string X = "X"; /// /// Y /// public const string Y = "Y"; /// /// W /// public const string W = "W"; /// /// H /// public const string H = "H"; /// /// 控件ID /// public const string CtrlID = "CtrlID"; /// /// 是否可编辑 /// public const string IsEdit = "IsEdit"; /// /// 是否必填项 /// public const string IsRequired = "IsRequired"; /// /// 显示分组 /// public const string GroupID = "GroupID"; } /// /// 图片附件 /// public class FrmImgAth : EntityMyPK { #region 属性 /// /// 名称 /// public string Name { get { return this.GetValStringByKey(FrmImgAthAttr.Name); } } public void setName(bool val) { this.SetValByKey(FrmImgAthAttr.Name, val); } /// /// 控件ID /// public string CtrlID { get { return this.GetValStringByKey(FrmImgAthAttr.CtrlID); } set { this.SetValByKey(FrmImgAthAttr.CtrlID, value); } } public void setCtrlID(string val) { this.SetValByKey(FrmImgAthAttr.CtrlID, val); } public float H { get { return this.GetValFloatByKey(FrmImgAthAttr.H); } set { this.SetValByKey(FrmImgAthAttr.H, value); } } public void setH(float val) { this.SetValByKey(FrmImgAthAttr.H, val); } public float W { get { return this.GetValFloatByKey(FrmImgAthAttr.W); } set { this.SetValByKey(FrmImgAthAttr.W, value); } } public void setW(float val) { this.SetValByKey(FrmImgAthAttr.W, val); } /// /// FK_MapData /// public string FrmID { get { return this.GetValStrByKey(FrmImgAthAttr.FrmID); } set { this.SetValByKey(FrmImgAthAttr.FrmID, value); } } /// /// 是否可编辑 /// public bool ItIsEdit { get { return this.GetValBooleanByKey(FrmImgAthAttr.IsEdit); } } public void setIsEdit(bool val) { this.SetValByKey(FrmImgAthAttr.IsEdit, val); } /// /// 是否必填,2016-11-1 /// public bool ItIsRequired { get { return this.GetValBooleanByKey(FrmImgAthAttr.IsRequired); } } public void setIsRequired(bool val) { this.SetValByKey(FrmImgAthAttr.IsRequired, val); } #endregion #region 构造方法 /// /// 图片附件 /// public FrmImgAth() { } /// /// 图片附件 /// /// public FrmImgAth(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_FrmImgAth", "图片附件"); map.IndexField = FrmImgAttr.FrmID; map.AddMyPK(); map.AddTBString(FrmImgAthAttr.FrmID, null, "表单ID", true, false, 1, 100, 20); map.AddTBString(FrmImgAthAttr.CtrlID, null, "控件ID", true, false, 0, 200, 20); map.AddTBString(FrmImgAthAttr.Name, null, "中文名称", true, false, 0, 200, 20); map.AddTBInt(FrmImgAthAttr.IsEdit, 1, "是否可编辑", true, true); map.AddTBInt(FrmImgAthAttr.IsRequired, 0, "是否必填项", true, true); map.AddTBString(MapAttrAttr.GUID, null, "GUID", true, false, 0, 128, 20); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeUpdateInsertAction() { this.MyPK = this.FrmID + "_" + this.CtrlID; MapAttr attr = new MapAttr(); attr.setMyPK(this.MyPK); if (attr.RetrieveFromDBSources() == 1) { attr.setName(this.Name); attr.Update(); } return base.beforeUpdateInsertAction(); } } /// /// 图片附件s /// public class FrmImgAths : EntitiesMyPK { #region 构造 /// /// 图片附件s /// public FrmImgAths() { } /// /// 图片附件s /// /// s public FrmImgAths(string fk_mapdata) { this.Retrieve(MapAttrAttr.FK_MapData, fk_mapdata); } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new FrmImgAth(); } } #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((FrmImgAth)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }