Esempio n. 1
0
    private void RenderMenu(string parentID, SystemMenuList menuList, TreeNode item, List <string> selected_list)
    {
        SystemMenuList subMenuList = menuList.Filter(parentID);

        subMenuList.SortByDisplayOrder();

        foreach (IMenuItem menu in subMenuList)
        {
            TreeNode subItem = new TreeNode(menu.MenuName, menu.Url);
            subItem.CssClass     = "SubMenu";
            subItem.MouseOverCss = "SubMenuOver";
            subItem.SelectedCss  = "SubMenuOver";
            BasePage base_page = this.Page as BasePage;
            subItem.Selected = selected_list.Contains(menu.MenuId);
            item.Nodes.Add(subItem);
            RenderMenu(menu.MenuId, menuList, subItem, selected_list);
        }
    }
Esempio n. 2
0
    private void RenderMenu(string parentID, SystemMenuList menuList, TreeView menuLeft, List <string> selected_list)
    {
        SystemMenuList subMenuList = menuList.Filter(parentID);

        subMenuList.SortByDisplayOrder();
        foreach (IMenuItem menu in subMenuList)
        {
            TreeNode item = new TreeNode(menu.MenuName, menu.Url);
            item.CssClass     = "MenuLeftCss";
            item.MouseOverCss = "MenuLeftMouseOverCss";
            item.SelectedCss  = "MenuLeftMouseOverCss";
            item.Selected     = selected_list.Contains(menu.MenuId);
            if (string.IsNullOrEmpty(menu.Url))
            {
                item.NodeType = NodeType.Text;
            }
            menuLeft.Nodes.Add(item);
            RenderMenu(menu.MenuId, menuList, item, selected_list);
        }
    }
Esempio n. 3
0
    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);
    }