Esempio n. 1
0
        public void GenerateMenu(string name, string position)
        {
            BioTemplate.Controller.Database.MenuCatalog getMenu = new Controller.Database.MenuCatalog();
            IList <Menu> topLevelMenus = Controller.Helper.TreeHelper.ConvertToForest(getMenu.GetMenuFromDb());

            ListMenu.Append("<ul class='nav metismenu' id='side-menu'>");
            ListMenu.Append("<li class='nav-header'>");
            ListMenu.Append("<div class='dropdown profile-element'>");
            ListMenu.Append("<span><img alt='image' class='img-circle' style='max-height: 48px; background-color: floralwhite;' src='" + VirtualPathUtility.ToAbsolute("~/Images/Login/ca-bio-logo-small.png") + "'/></span>");
            ListMenu.Append("<a data-toggle='dropdown' class='dropdown-toggle' href='#'>");
            ListMenu.Append("<span class='clear'>");
            ListMenu.Append("<span class='block m-t-sm'>");
            ListMenu.Append("<asp:Label ID='lblName' runat='server' class='font-bold' Style='color: white;'>" + name + "</asp:Label>");
            ListMenu.Append("</span>");
            ListMenu.Append("<span class='text-muted m-t-xs block'>" + position + "<b class='caret'></b>");
            ListMenu.Append("</span>");
            ListMenu.Append("</span>");
            ListMenu.Append("</a>");
            ListMenu.Append("<ul class='dropdown-menu animated fadeInRight m-t-xs'>");
            ListMenu.Append("<li><a href='profile.html'>Profile</a></li>");
            ListMenu.Append("<li><a href='contacts.html'>Contacts</a></li>");
            ListMenu.Append("<li><a href='mailbox.html'>Mailbox</a></li>");
            ListMenu.Append("<li class='divider'></li>");
            ListMenu.Append("<li><a href='login.html'>Logout</a></li>");
            ListMenu.Append("</ul>");
            ListMenu.Append("</div>");
            ListMenu.Append("<div class='logo-element'>BIO+</div>");
            ListMenu.Append("</li>");
            foreach (Menu topLevelMenu in topLevelMenus)
            {
                RenderMenuItems(topLevelMenu);
            }
            ListMenu.Append("</ul>");
        }
Esempio n. 2
0
        public void GenerateBreadCrumbs(int currentMenuId, string currentMenu)
        {
            BioTemplate.Controller.Database.MenuCatalog getMenu = new Controller.Database.MenuCatalog();
            IList <Menu> listMenu = Controller.Helper.TreeHelper.ConvertToForest(getMenu.GetMenuFromDb());
            int          i        = 1;

            RenderBreadCrumbsRoot();
            foreach (Menu menu in BioTemplate.Controller.Helper.TreeHelper.FromRootToNode(GetCurrentMenu(listMenu, currentMenu, currentMenuId)))
            {
                if (i != BioTemplate.Controller.Helper.TreeHelper.FromRootToNode(GetCurrentMenu(listMenu, currentMenu, currentMenuId)).Count)
                {
                    RenderBreadCrumbs(menu.MenuName, menu.NavUrl.ToString());
                    i++;
                }
                else
                {
                    RenderBreadCrumbsLeaf(menu.MenuName);
                }
            }
        }