using BP.DA; using BP.En; namespace BP.CCFast.CCMenu { public class SearchAttrAttr:EntityNoNameAttr { public const string RefMenuNo = "RefMenuNo"; public const string Icon = "Icon"; public const string UrlExt = "UrlExt"; public const string Tag1 = "Tag1"; public const string Idx = "Idx"; } /// /// 查询条件 /// public class SearchAttr : EntityNoName { #region 属性 public override UAC HisUAC { get { UAC uac = new UAC(); if (BP.Web.WebUser.IsAdmin == true) { uac.IsDelete = true; uac.IsUpdate = true; uac.IsInsert = true; return uac; } else { uac.Readonly(); } return uac; } } #endregion #region 构造方法 /// /// 查询条件 /// public SearchAttr() { } protected override bool beforeDelete() { return base.beforeDelete(); } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("GPM_MenuDtl", "查询条件"); // 类的基本属性. map.setEnType(EnType.Sys); map.AddTBStringPK(SearchAttrAttr.No, null, "编号", false, false, 1, 90, 50); map.AddTBString(SearchAttrAttr.RefMenuNo, null, "菜单编号", false, false, 0, 100, 100); map.AddTBString(SearchAttrAttr.Name, null, "条件标签", true, false, 0, 300, 100, true); map.AddTBString(SearchAttrAttr.Tag1, null, "标识", true, false, 0, 500, 100, true); map.AddTBString(SearchAttrAttr.UrlExt, null, "SQL/标记/枚举值", true, false, 0, 500, 500, true); map.AddTBInt(SearchAttrAttr.Idx, 0, "Idx", true, false); map.AddDtl(new SearchAttrs(), SearchAttrAttr.RefMenuNo); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeInsert() { this.No = DBAccess.GenerGUID(); return base.beforeInsert(); } protected override bool beforeUpdateInsertAction() { return base.beforeUpdateInsertAction(); } } /// /// 查询条件s /// public class SearchAttrs : EntitiesNoName { #region 构造 /// /// 查询条件s /// public SearchAttrs() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new SearchAttr(); } } #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((SearchAttr)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }