Example #1
0
        private void LoadRootMenuItems(TreeNodeCollection treeNodeCollection, MenuService.EMenuType mItemType)
        {
            foreach (var c in MenuService.GetChildMenuItemsByParentId(0, mItemType))
            {
                var newNode = new ButtonTreeNodeMenu
                    {
                        Text = c.MenuItemName,
                        MessageToDel =
                            Server.HtmlEncode(string.Format(
                                Resource.Admin_MasterPageAdminCatalog_MenuConfirmation, c.MenuItemName)),
                        Value = c.MenuItemID.ToString(),
                        NavigateUrl = "Menu.aspx?MenuId=" + c.MenuItemID + "&type=" + mItemType,
                        TreeView = tree,
                        MenuType = mItemType,
                        Selected = c.MenuItemID == _menuId
                    };

                if (c.HasChild)
                {
                    newNode.Expanded = false;
                    newNode.PopulateOnDemand = true;
                }
                treeNodeCollection.Add(newNode);
            }
        }
Example #2
0
 private void LoadChildMenuItems(TreeNode node, MenuService.EMenuType mItemType)
 {
     foreach (var c in MenuService.GetChildMenuItemsByParentId(SQLDataHelper.GetInt(node.Value), mItemType))
     {
         var newNode = new ButtonTreeNodeMenu
             {
                 Text = c.Enabled ? c.MenuItemName : string.Format("<span style=\"color:grey;\">{0}</span>", c.MenuItemName),
                 MessageToDel =
                     Server.HtmlEncode(string.Format(
                         Resource.Admin_MasterPageAdminCatalog_MenuConfirmation, c.MenuItemName)),
                 Value = c.MenuItemID.ToString(),
                 NavigateUrl = "Menu.aspx?MenuID=" + c.MenuItemID + "&type=" + mItemType,
                 TreeView = tree,
                 MenuType = mItemType,
                 Selected = c.MenuItemID == _menuId
             };
         if (c.HasChild)
         {
             newNode.Expanded = false;
             newNode.PopulateOnDemand = true;
         }
         else
         {
             newNode.Expanded = true;
             newNode.PopulateOnDemand = false;
         }
         node.ChildNodes.Add(newNode);
     }
 }