using System; using System.Collections; using BP.DA; using BP.En; namespace BP.Sys { /// /// 附件在扩展控件里的显示方式 /// public enum AthShowModel { /// /// 简单的 /// Simple, /// /// 只有文件名称 /// FileNameOnly } /// /// 扩展控件属性 /// public class ExtContralAttr : EntityOIDNameAttr { /// /// 主表 /// public const string FK_MapData = "FK_MapData"; /// /// X1 /// public const string X1 = "X1"; /// /// Y1 /// public const string Y1 = "Y1"; /// /// X2 /// public const string X2 = "X2"; /// /// Y2 /// public const string Y2 = "Y2"; /// /// 宽度 /// public const string BorderWidth = "BorderWidth"; /// /// 颜色 /// public const string BorderColor = "BorderColor"; /// /// GUID /// public const string GUID = "GUID"; } /// /// 扩展控件 /// public class ExtContral : EntityMyPK { #region 基本-属性 /// /// 表单ID /// public string FK_MapData { get { return this.GetValStrByKey(MapAttrAttr.FK_MapData); } set { this.SetValByKey(MapAttrAttr.FK_MapData, value); } } /// /// 字段名 /// public string KeyOfEn { get { return this.GetValStrByKey(MapAttrAttr.KeyOfEn); } set { this.SetValByKey(MapAttrAttr.KeyOfEn, value); } } /// /// 控件类型 /// public UIContralType UIContralType { get { return (UIContralType)this.GetValIntByKey(MapAttrAttr.UIContralType); } set { this.SetValByKey(MapAttrAttr.UIContralType, (int)value); } } #endregion #region 附件属性 /// /// 关联的字段. /// public string AthRefObj { get { return this.GetParaString("AthRefObj"); } set { this.SetPara("AthRefObj", value); } } /// /// 显示方式 /// public AthShowModel AthShowModel { get { return (AthShowModel)this.GetParaInt("AthShowModel"); } set { this.SetPara("AthShowModel", (int)value); } } #endregion 附件属性 #region 构造方法 /// /// 扩展控件 /// public ExtContral() { } public ExtContral(string fk_mapdata, string keyofEn) { this.setMyPK(fk_mapdata + "_" + keyofEn); this.Retrieve(); } public ExtContral(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_MapAttr", "扩展控件"); map.AddMyPK(); map.AddTBString(MapAttrAttr.FK_MapData, null, "实体标识", true, true, 1, 100, 20); map.AddTBString(MapAttrAttr.KeyOfEn, null, "属性", true, true, 1, 200, 20); map.AddTBString(MapAttrAttr.Name, null, "描述", true, false, 0, 200, 20); map.AddTBString(MapAttrAttr.DefVal, null, "默认值", false, false, 0, 4000, 20); map.AddTBInt(MapAttrAttr.UIContralType, 0, "控件", true, false); map.AddTBInt(MapAttrAttr.MyDataType, 0, "数据类型", true, false); map.AddDDLSysEnum(MapAttrAttr.LGType, 0, "逻辑类型", true, false, MapAttrAttr.LGType, "@0=普通@1=枚举@2=外键@3=打开系统页面"); map.AddTBFloat(MapAttrAttr.UIWidth, 100, "宽度", true, false); map.AddTBFloat(MapAttrAttr.UIHeight, 23, "高度", true, false); map.AddTBInt(MapAttrAttr.MinLen, 0, "最小长度", true, false); map.AddTBInt(MapAttrAttr.MaxLen, 300, "最大长度", true, false); map.AddTBString(MapAttrAttr.UIBindKey, null, "绑定的信息", true, false, 0, 100, 20); map.AddTBString(MapAttrAttr.UIRefKey, null, "绑定的Key", true, false, 0, 30, 20); map.AddTBString(MapAttrAttr.UIRefKeyText, null, "绑定的Text", true, false, 0, 30, 20); map.AddBoolean(MapAttrAttr.UIVisible, true, "是否可见", true, true); map.AddBoolean(MapAttrAttr.UIIsEnable, true, "是否启用", true, true); map.AddBoolean(MapAttrAttr.UIIsLine, false, "是否单独栏显示", true, true); map.AddBoolean(MapAttrAttr.UIIsInput, false, "是否必填字段", true, true); //map.AddTBFloat(MapAttrAttr.X, 5, "X", true, false); //map.AddTBFloat(MapAttrAttr.Y, 5, "Y", false, false); map.AddTBString(MapAttrAttr.Tag, null, "标识(存放临时数据)", true, false, 0, 100, 20); map.AddTBInt(MapAttrAttr.EditType, 0, "编辑类型", true, false); //单元格数量。2013-07-24 增加。 map.AddTBInt(MapAttrAttr.ColSpan, 1, "单元格数量", true, false); // map.AddTBInt(MapAttrAttr.ColSpan, 1, "单元格数量", true, false); map.AddTBInt(MapAttrAttr.Idx, 0, "序号", true, false); map.AddTBString(MapAttrAttr.GUID, null, "GUID", true, false, 0, 128, 20); //参数属性. map.AddTBAtParas(4000); // this._enMap = map; return this._enMap; } } #endregion } /// /// 扩展控件s /// public class ExtContrals : EntitiesMyPK { #region 构造 /// /// 扩展控件s /// public ExtContrals() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new ExtContral(); } } #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((ExtContral)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }