private void LoadMenu() { Authorization.Authorization author = CurrentAuthor; IList<MenuEntity> menuList = author.GetAuthorizeMenus(); UsersEntity currUser = author.GetAuthorizeUsers(); LoadLogo(); if (currUser != null && menuList != null && menuList.Count > 0) { lbl_UserName.Text = currUser.ChildAccount + "@" + currUser.ParentAccount; lbl_Balance.Text = currUser.Balance.ToString(); myMenu.Clear(); foreach (MenuEntity menuFirst in menuList) { if (menuFirst.ParentID == 0) { ucMenuBar mb = new ucMenuBar(menuFirst.ID, menuFirst.ImageUrl, menuFirst.DisplayName, menuFirst.LinkUrl, "mainframe"); foreach (MenuEntity menuSec in menuList) { if (menuSec.ParentID == mb.ID) { ucMenuItem mi = new ucMenuItem(menuSec.ImageUrl, menuSec.DisplayName, menuSec.LinkUrl, "mainframe"); mb.Add(mi); } } myMenu.Add(mb); } } ucMenuBar mb3 = new ucMenuBar(99, "images/search.png", "飞扬短信营销平台 V1.0", "../WelcomePage.aspx", "mainframe"); myMenu.Add(mb3); myMenu.MenuBarList[0].Expand = true; } }
public void Add(ucMenuBar mbar) { if (MenuBarList == null) MenuBarList = new List<ucMenuBar>(); MenuBarList.Add(mbar); }