private void LoadData() { List <SysMenu> menu_list = MenuBiz.GetAllMenus(); this.DataGridMenu.DataSource = menu_list; this.DataGridMenu.DataBind(); }
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); }