Exemplo n.º 1
0
        public List <AdminMenuGroup> getAdminMenuList()
        {
            List <AdminMenuGroup> lsAdminMenuGroup = new List <AdminMenuGroup>();
            var LoginName  = AdminUserContext.Current.LoginInfo.LoginName;//.BusinessPermissionList.Select(p => p.ToString());
            var LanguageID = AdminUserContext.Current.LoginInfo.LanguageID;
            //LanguageID = "0";
            string strSql = "Select DISTINCT a.AuthorityID,b.AuthorityName,a.ModuleUrl,a.WebUrl,b.Info,a.DivID,a.UlID,a.Icon,a.Class" +
                            " From Authority a" +
                            " Inner Join AuthorityLang b ON a.AuthorityID = b.AuthorityID" +
                            " Inner Join RoleAuthority c ON a.AuthorityID = c.AuthorityID" +
                            " Inner Join UserRole d ON c.RoleID = d.RoleID" +
                            " Inner Join [User] e ON d.UserID = e.ID" +
                            " Where a.TypeID = '20000' And b.LangID = '" + LanguageID + "' And e.LoginName = '" + LoginName + "'";
            DataTable dtMenu = SQLHelper.ExecuteSqlReturnDataTable(strSql);

            for (int i = 0; i < dtMenu.Rows.Count; i++)
            {
                DataRow        dr   = dtMenu.Rows[i];
                AdminMenuGroup item = new AdminMenuGroup();
                item.Id    = Convert.ToInt32(dr["AuthorityID"]);
                item.Name  = dr["AuthorityName"].ToString();
                item.Url   = dr["WebUrl"].ToString();
                item.Info  = dr["Info"].ToString();
                item.DivId = dr["DivID"].ToString();
                item.UlId  = dr["UlID"].ToString();
                item.Icon  = dr["Icon"].ToString();
                item.Class = dr["Class"].ToString();
                lsAdminMenuGroup.Add(item);
            }
            return(lsAdminMenuGroup);
        }
Exemplo n.º 2
0
        public List <AdminMenuGroupAll> getAdminMenuDetailsList()
        {
            List <AdminMenuGroupAll> lsAdminMenuGroupAll = new List <AdminMenuGroupAll>();
            var LoginName  = AdminUserContext.Current.LoginInfo.LoginName;//.BusinessPermissionList.Select(p => p.ToString());
            var LanguageID = AdminUserContext.Current.LoginInfo.LanguageID;
            //LanguageID = "0";
            string strSql1 = "Select DISTINCT a.AuthorityID,a.TypeID,b.AuthorityName,a.ModuleUrl,a.WebUrl,b.Info,a.DivID,a.UlID,a.Icon,a.Class,a.MenuLayer,a.WebID" +
                             " From Authority a" +
                             " Inner Join AuthorityLang b ON a.AuthorityID = b.AuthorityID" +
                             " Inner Join RoleAuthority c ON a.AuthorityID = c.AuthorityID" +
                             " Inner Join UserRole d ON c.RoleID = d.RoleID" +
                             " Inner Join [User] e ON d.UserID = e.ID";
            string    strSql = strSql1 + " Where a.TypeID='20000' And b.LangID='" + LanguageID + "' And e.LoginName='" + LoginName + "'";
            DataTable dtMenu = SQLHelper.ExecuteSqlReturnDataTable(strSql);

            for (int i = 0; i < dtMenu.Rows.Count; i++)
            {
                AdminMenuGroupAll     itemAll          = new AdminMenuGroupAll();
                List <AdminMenuGroup> lsAdminMenuGroup = new List <AdminMenuGroup>();
                itemAll.DivId = dtMenu.Rows[i]["DivID"].ToString();
                var       TypeID = Convert.ToInt32(dtMenu.Rows[i]["AuthorityID"]);
                DataTable dt     = getSubAdminMenuDetails(strSql1, TypeID, LoginName, LanguageID);
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    AdminMenuGroup item = new AdminMenuGroup();
                    DataRow        dr   = dt.Rows[j];
                    item.Id        = Convert.ToInt32(dr["AuthorityID"]);
                    item.Name      = dr["AuthorityName"].ToString();
                    item.Url       = dr["WebUrl"].ToString();
                    item.Info      = dr["Info"].ToString();
                    item.DivId     = dr["DivID"].ToString();
                    item.UlId      = dr["UlID"].ToString();
                    item.Icon      = dr["Icon"].ToString();
                    item.Class     = dr["Class"].ToString();
                    item.MenuLayer = dr["MenuLayer"].ToString();
                    item.WebId     = dr["WebID"].ToString();
                    var              TypeID1     = Convert.ToInt32(dr["AuthorityID"]);
                    DataTable        dt1         = getSubAdminMenuDetails(strSql1, TypeID1, LoginName, LanguageID);
                    List <AdminMenu> lsAdminMenu = new List <AdminMenu>();
                    for (int k = 0; k < dt1.Rows.Count; k++)
                    {
                        AdminMenu item1 = new AdminMenu();
                        DataRow   dr1   = dt1.Rows[k];
                        item1.Id        = Convert.ToInt32(dr1["AuthorityID"]);
                        item1.Name      = dr1["AuthorityName"].ToString();
                        item1.Url       = dr1["WebUrl"].ToString();
                        item1.Info      = dr1["Info"].ToString();
                        item1.DivId     = dr1["DivID"].ToString();
                        item1.UlId      = dr1["UlID"].ToString();
                        item1.Icon      = dr1["Icon"].ToString();
                        item1.Class     = dr1["Class"].ToString();
                        item1.MenuLayer = dr1["MenuLayer"].ToString();
                        item1.WebId     = dr1["WebID"].ToString();
                        lsAdminMenu.Add(item1);
                    }
                    item.AdminMenuArray = lsAdminMenu;
                    lsAdminMenuGroup.Add(item);
                }
                itemAll.AdminMenuGroup = lsAdminMenuGroup;
                lsAdminMenuGroupAll.Add(itemAll);
            }
            return(lsAdminMenuGroupAll);
        }