Example #1
0
        private void LoadMenuTree()
        {
            menuTree.Nodes.Clear();
            BaseModuleMethod  basemoduleMethod = new BaseModuleMethod();
            List <BaseModule> moduleList       = basemoduleMethod.GetList("");

            foreach (BaseModule bm in moduleList)
            {
                TreeNode node = new TreeNode();
                node.Text = bm.Name;
                node.Tag  = bm;
                menuTree.Nodes.Add(node);
                BaseMenuMethod  baseMenuMethod = new BaseMenuMethod();
                List <BaseMenu> menuList       = baseMenuMethod.GetList(bm.ModuleId);
                foreach (BaseMenu menu in menuList)
                {
                    TreeNode nd = new TreeNode();
                    nd.Text = menu.Name;
                    nd.Tag  = menu;
                    node.Nodes.Add(nd);
                    recursionMenu(bm.ModuleId, menu.MenuId, nd);
                }
            }
            menuTree.ExpandAll();
        }
Example #2
0
        private void recursionMenu(int moduleId, int menuID, TreeNode nd)
        {
            BaseMenuMethod  baseMenuMethod = new BaseMenuMethod();
            List <BaseMenu> menuList       = baseMenuMethod.GetList(moduleId, menuID);

            foreach (BaseMenu item in menuList)
            {
                TreeNode node = new TreeNode();
                node.Text = item.Name;
                node.Tag  = item;
                nd.Nodes.Add(node);
                recursionMenu(moduleId, item.MenuId, node);
            }
        }
Example #3
0
        private void recursionMenu(int groupid, int moduleId, int menuID, TreeNode nd)
        {
            BaseMenuMethod  baseMenuMethod = new BaseMenuMethod();
            List <BaseMenu> menuList       = baseMenuMethod.GetList(moduleId, menuID);

            foreach (BaseMenu item in menuList)
            {
                TreeNode node = new TreeNode();
                node.Text = item.Name;
                node.Tag  = item;

                if (bgM.exist(groupid, item.ModuleId, item.MenuId))
                {
                    node.Checked = true;
                }
                nd.Nodes.Add(node);
                recursionMenu(groupid, moduleId, item.MenuId, node);
            }
        }