public string MainMenuUl() { if (Session["LoginUserInfo"] == null) return "<ul id=jsddm class='sf-menu'><li><a href='default.aspx'>please login.</a></li></ul>"; AdminMenuBiz mbiz = new AdminMenuBiz(); menuDt = mbiz.GetMenuItems(false); return "<ul id=jsddm class='sf-menu'>" + MenuItemToString(90) + "</ul>"; }
public static string MenuUL(this HtmlHelper helper) { D_LoginUserInfo ui = HttpContext.Current.Session["LoginUserInfo"] as D_LoginUserInfo; if (ui == null || ui.userId <= 0) return "<ul id=jsddm class='sf-menu'><li><a href='/home/login'>Please login.</a></li></ul>"; AdminMenuBiz mbiz = new AdminMenuBiz(); menuDt = mbiz.GetMenuItemsByRoles(ui.roleIds); return "<ul id=jsddm class='sf-menu'>" + MenuItemToString(90) + "</ul>"; }
public static void LoadMainMenu(Menu menu) { if (menu == null) return; com.Omei.OmeiDataSet.D_LoginUserInfo ui = HttpContext.Current.Session["LoginUserInfo"] as com.Omei.OmeiDataSet.D_LoginUserInfo; if (ui == null || ui.userId <= 0) return; AdminMenuBiz biz = new AdminMenuBiz(); DS_Menu.MenuItemDataTable menuDt = biz.GetMenuItemsByRoles(ui.roleIds); menuItemCount = 0; AddMenuItems(menuDt, menu.Items, 90); }
private void LoadMenu() { tvMenu.Nodes.Clear(); AdminMenuBiz mbiz = new AdminMenuBiz(); ActionAuthorization biz = new ActionAuthorization(); DS_Menu.MenuItemDataTable dt = mbiz.GetMenuItems(true); DS_Authorization.AuthActionDataTable actionTable = biz.GetActions(); LoadSubMenu(tvMenu.Nodes, 0, dt, actionTable); }
public void reLoadSiteMap() { // Clear the state of the collections and rootNode rootNode = null; siteMapNodes.Clear(); childParentRelationship.Clear(); nodeIDs.Clear(); SiteMapNode temp = null; string navUrl = null; AdminMenuBiz mbiz = new AdminMenuBiz(); DS_Menu.MenuItemDataTable dt = mbiz.GetMenuItems(true); DataRow[] rows = dt.Select("status=1", "parentId,menuId"); foreach (DS_Menu.MenuItemRow row in rows) { navUrl = HttpRuntime.AppDomainAppVirtualPath + "/" + row.navigateUrl; temp = new SiteMapNode(this, row.menuID.ToString(), navUrl, row.title, row.description); nodeIDs.Add(new DictionaryEntry(row.menuID, navUrl.ToUpper())); siteMapNodes.Add(new DictionaryEntry(row.menuID, temp)); // Is this a root node yet? if (row.parentID == 0) { rootNode = temp; } // If not the root node, add the node to the various collections. else { // The parent node has already been added to the collection. SiteMapNode parentNode = GetNodeByID(row.parentID); if (parentNode != null) { childParentRelationship.Add(new DictionaryEntry(row.menuID, row.parentID)); } else { throw new Exception("Parent node not found for current node."); } } } }