/// <summary> /// Filter /// </summary> /// <param name="parentID">parentID </param> /// <returns>SystemMenuList </returns> public SystemMenuList Filter(string parentID) { SystemMenuList menuList = new SystemMenuList(); foreach (IMenuItem menu in this) { if (menu.ParentId.Trim() == parentID.Trim()) { menuList.Add(menu); } } return(menuList); }
private void BuildMenu() { TreeViewMenu.MarginBase = 5; TreeViewMenu.LevelIncrease = 10; List <SysMenu> sourceMenuList; BasePage base_page = this.Page as BasePage; if (base_page != null) { string emp_id = base_page.CurrentUser.UserId; sourceMenuList = HomePageBiz.GetMenuListByUser(emp_id); } else { sourceMenuList = MenuBiz.GetAllMenus(); } Trace.Write("count of menus: " + sourceMenuList.Count.ToString()); SystemMenuList systemMenus = new SystemMenuList(); foreach (SysMenu sourceMenu in sourceMenuList) { if (sourceMenu.IsValid.ToUpper() == "Y") { sourceMenu.Url = GetAbsoluteMenuUrl(sourceMenu.Url); systemMenus.Add(sourceMenu); } } systemMenus.SortByDisplayOrder(); List <string> selected_list = this.GetSelectedList(sourceMenuList); RenderMenu(MenuBiz.RootMenuID, systemMenus, TreeViewMenu, selected_list); }