Example #1
0
 public DS_Menu.MenuItemDataTable GetMenuItemsByRoles(string roles)
 {
     DS_Menu ds = new DS_Menu();
     string sql = @"
     SELECT menuID, parentID, title, description, pageName, menuOrder, navigateUrl, status, menuType
     FROM AdminMenu
     WHERE menuID in (
     select DISTINCT menuID
     from authRoleAction
     where menuID>0 and roleID in (0,"+ roles +")) and status=1 and menuType=10";
     m_dao.FillDataSet(ds, "MenuItem", sql, null);
     return ds.MenuItem;
 }
Example #2
0
        public DS_Menu.MenuItemDataTable GetMenuItems(bool getAllItems)
        {
            string sql = @"
            SELECT menuID, parentID, title, description, pageName, menuOrder, navigateUrl, status,
              menuType
            FROM AdminMenu";
            if (!getAllItems)
                sql += " WHERE status=1";

            DS_Menu ds = new DS_Menu();
            m_dao.FillDataSet(ds, "MenuItem", sql, null);
            return ds.MenuItem;
        }
Example #3
0
    private static void AddMenuItems(DS_Menu.MenuItemDataTable menuTable, MenuItemCollection pnode, int nodeId)
    {
        if(menuTable==null || pnode==null || menuItemCount>500) return;

        DataRow[] rows = menuTable.Select("status=1 and parentId=" + nodeId.ToString(), "parentID, menuOrder");
        foreach (DS_Menu.MenuItemRow row in rows)
        {
            MenuItem item = new MenuItem();
            item.Text = row.title;
            item.Value = row.menuID.ToString();
            item.NavigateUrl = row.navigateUrl;
            pnode.Add(item);
            menuItemCount++;
            AddMenuItems(menuTable, item.ChildItems, row.menuID);
        }
    }
Example #4
0
 private void LoadSubMenu(TreeNodeCollection pnode, int parentID,
     DS_Menu.MenuItemDataTable menuTable,
     DS_Authorization.AuthActionDataTable actionTable)
 {
     DataRow[] rows = menuTable.Select("parentID=" + parentID.ToString(), "menuOrder");
     foreach (DS_Menu.MenuItemRow row in rows)
     {
         string title = row.title;
         if (row.status < 1)
             title = "<del>" + title + "</del>";
         TreeNode node = new TreeNode(title, "m" + row.menuID.ToString());
         if (row.menuType == 10)
             node.ImageUrl = "~/Images/res/blog.gif";
         else
             node.ImageUrl = "~/Images/res/WebCmd.gif";
         pnode.Add(node);
         LoadSubMenu(node.ChildNodes, row.menuID, menuTable, actionTable);
     }
     LoadActions(pnode, parentID, actionTable);
 }