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