using BP.En; namespace BP.CCFast.CCMenu { /// /// 角色菜单 /// public class StationMenuAttr { /// /// 菜单 /// public const string FK_Menu = "FK_Menu"; /// /// 角色 /// public const string FK_Station = "FK_Station"; /// /// 是否选中. /// public const string IsChecked = "IsChecked"; } /// /// 角色菜单 /// public class StationMenu : EntityMyPK { #region 属性 /// /// 菜单 /// public string FK_Menu { get { return this.GetValStringByKey(StationMenuAttr.FK_Menu); } set { this.SetValByKey(StationMenuAttr.FK_Menu, value); } } /// /// 角色 /// public string FK_Station { get { return this.GetValStringByKey(StationMenuAttr.FK_Station); } set { this.SetValByKey(StationMenuAttr.FK_Station, value); } } /// /// 是否选中 /// public string IsChecked { get { return this.GetValStringByKey(StationMenuAttr.IsChecked); } set { this.SetValByKey(StationMenuAttr.IsChecked, value); } } #endregion #region 构造方法 /// /// 角色菜单 /// public StationMenu() { } /// /// 角色菜单 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("GPM_StationMenu", "角色菜单"); map.setEnType(EnType.Sys); map.AddMyPK(); map.AddTBString(StationMenuAttr.FK_Menu, null, "菜单", false, false, 0, 50, 20); map.AddTBString(StationMenuAttr.FK_Station, null, "角色", false, false, 0, 50, 20); //map.AddDDLEntities(StationMenuAttr.FK_Station, null, "角色", new BP.Port.Stations(), true); map.AddBoolean(StationMenuAttr.IsChecked, true, "是否选中", true, true); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeInsert() { this.MyPK = this.FK_Menu + "_" + this.FK_Station; return base.beforeInsert(); } } /// /// 角色菜单s /// public class StationMenus : EntitiesMyPK { #region 构造 /// /// 角色s /// public StationMenus() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new StationMenu(); } } #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((StationMenu)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }