Exemple #1
0
        private List <SysMenuEntity> GetSysMenuDetailList(int?menuId = null)
        {
            var listSysMenuEntity          = GetSysMenuList(menuId);
            var listSysModuleEnumEntity    = new SysModuleEnumBiz().GetSysModuleEnumList();
            var listSysFuncPointEnumEntity = new SysFuncPointEnumBiz().GetSysFuncPointEnumList();
            var query = from sysMenuEntity in listSysMenuEntity
                        join sysModuleEnumEntity in listSysModuleEnumEntity on sysMenuEntity.ModuleId equals
                        sysModuleEnumEntity.Name into r1
                        from sysModuleEnumEntity in r1.DefaultIfEmpty()
                        join sysFuncPointEnumEntity in listSysFuncPointEnumEntity on sysMenuEntity.FuncPointId equals
                        sysFuncPointEnumEntity.Name into r2
                        from sysFuncPointEnumEntity in r2.DefaultIfEmpty()
                        select new SysMenuEntity()
            {
                MenuId        = sysMenuEntity.MenuId,
                MenuName      = sysMenuEntity.MenuName,
                MenuLevel     = sysMenuEntity.MenuLevel,
                Seq           = sysMenuEntity.Seq,
                FatherNode    = sysMenuEntity.FatherNode,
                Description   = sysMenuEntity.Description,
                PageUrl       = sysMenuEntity.PageUrl,
                UrlParameter  = sysMenuEntity.UrlParameter,
                ActivityFlag  = sysMenuEntity.ActivityFlag,
                DeleteFlag    = sysMenuEntity.DeleteFlag,
                ModuleId      = sysMenuEntity.ModuleId,
                FuncPointId   = sysMenuEntity.FuncPointId,
                ModuleName    = sysModuleEnumEntity == null ? "-" : sysModuleEnumEntity.Description,
                FuncPointName = sysFuncPointEnumEntity == null ? "-" : sysFuncPointEnumEntity.Description,
            };
            var list = query.ToList <SysMenuEntity>();

            return(list);
        }
Exemple #2
0
        private List <SysRelationEntity> SetSysRelationListCache()
        {
            var listSysRelationEntity      = EntityExecution.SelectAll <SysRelationEntity>();
            var listSysModuleEnumEntity    = new SysModuleEnumBiz().GetSysModuleEnumList();
            var listSysFuncPointEnumEntity = new SysFuncPointEnumBiz().GetSysFuncPointEnumList();
            var query = from sysRelationEntity in listSysRelationEntity
                        join sysModuleEnumEntity in listSysModuleEnumEntity on sysRelationEntity.ModuleId equals
                        sysModuleEnumEntity.Name
                        join sysFuncPointEnumEntity in listSysFuncPointEnumEntity on sysRelationEntity.FuncPointId equals
                        sysFuncPointEnumEntity.Name
                        select new SysRelationEntity()
            {
                ModuleId      = sysRelationEntity.ModuleId,
                FuncPointId   = sysRelationEntity.FuncPointId,
                Permissions   = sysRelationEntity.Permissions,
                ModuleName    = sysModuleEnumEntity.Description,
                FuncPointName = sysFuncPointEnumEntity.Description,
            };

            listSysRelationEntity = query.ToList <SysRelationEntity>();
            foreach (SysRelationEntity sysRelationEntity in listSysRelationEntity)
            {
                if (!string.IsNullOrEmpty(sysRelationEntity.Permissions))
                {
                    sysRelationEntity.PermissionList     = new List <string>();
                    sysRelationEntity.PermissionListName = new List <string>();
                    var list = sysRelationEntity.Permissions.Split(',').ToList();
                    foreach (string s in list)
                    {
                        if (!string.IsNullOrEmpty(s))
                        {
                            sysRelationEntity.PermissionList.Add(s);
                            sysRelationEntity.PermissionListName.Add(SysEnumNameExBiz.GetDescription <SysFuncPointEnum>(s));
                        }
                    }
                    if (sysRelationEntity.PermissionListName.Count > 0)
                    {
                        sysRelationEntity.PermissionsName = string.Join(",",
                                                                        sysRelationEntity.PermissionListName.ToArray());
                    }
                }
            }
            DataCache.SetCache(CacheKey, listSysRelationEntity);
            return(listSysRelationEntity);
        }
Exemple #3
0
 private List<SysRelationEntity> SetSysRelationListCache()
 {
     var listSysRelationEntity = EntityExecution.SelectAll<SysRelationEntity>();
     var listSysModuleEnumEntity = new SysModuleEnumBiz().GetSysModuleEnumList();
     var listSysFuncPointEnumEntity = new SysFuncPointEnumBiz().GetSysFuncPointEnumList();
     var query = from sysRelationEntity in listSysRelationEntity
         join sysModuleEnumEntity in listSysModuleEnumEntity on sysRelationEntity.ModuleId equals
             sysModuleEnumEntity.Name
         join sysFuncPointEnumEntity in listSysFuncPointEnumEntity on sysRelationEntity.FuncPointId equals
             sysFuncPointEnumEntity.Name
         select new SysRelationEntity()
         {
             ModuleId = sysRelationEntity.ModuleId,
             FuncPointId = sysRelationEntity.FuncPointId,
             Permissions = sysRelationEntity.Permissions,
             ModuleName = sysModuleEnumEntity.Description,
             FuncPointName = sysFuncPointEnumEntity.Description,
         };
     listSysRelationEntity = query.ToList<SysRelationEntity>();
     foreach (SysRelationEntity sysRelationEntity in listSysRelationEntity)
     {
         if (!string.IsNullOrEmpty(sysRelationEntity.Permissions))
         {
             sysRelationEntity.PermissionList = new List<string>();
             sysRelationEntity.PermissionListName = new List<string>();
             var list = sysRelationEntity.Permissions.Split(',').ToList();
             foreach (string s in list)
             {
                 if (!string.IsNullOrEmpty(s))
                 {
                     sysRelationEntity.PermissionList.Add(s);
                     sysRelationEntity.PermissionListName.Add(SysEnumNameExBiz.GetDescription<SysFuncPointEnum>(s));
                 }
             }
             if (sysRelationEntity.PermissionListName.Count > 0)
                 sysRelationEntity.PermissionsName = string.Join(",",
                     sysRelationEntity.PermissionListName.ToArray());
         }
     }
     DataCache.SetCache(CacheKey, listSysRelationEntity);
     return listSysRelationEntity;
 }
Exemple #4
0
 private List<SysMenuEntity> GetSysMenuDetailList(int? menuId = null)
 {
     var listSysMenuEntity = GetSysMenuList(menuId);
     var listSysModuleEnumEntity = new SysModuleEnumBiz().GetSysModuleEnumList();
     var listSysFuncPointEnumEntity = new SysFuncPointEnumBiz().GetSysFuncPointEnumList();
     var query = from sysMenuEntity in listSysMenuEntity
                 join sysModuleEnumEntity in listSysModuleEnumEntity on sysMenuEntity.ModuleId equals
                     sysModuleEnumEntity.Name into r1
                 from sysModuleEnumEntity in r1.DefaultIfEmpty()
                 join sysFuncPointEnumEntity in listSysFuncPointEnumEntity on sysMenuEntity.FuncPointId equals
                     sysFuncPointEnumEntity.Name into r2
                 from sysFuncPointEnumEntity in r2.DefaultIfEmpty()
                 select new SysMenuEntity()
                 {
                     MenuId = sysMenuEntity.MenuId,
                     MenuName = sysMenuEntity.MenuName,
                     MenuLevel = sysMenuEntity.MenuLevel,
                     Seq = sysMenuEntity.Seq,
                     FatherNode = sysMenuEntity.FatherNode,
                     Description = sysMenuEntity.Description,
                     PageUrl = sysMenuEntity.PageUrl,
                     UrlParameter = sysMenuEntity.UrlParameter,
                     ActivityFlag = sysMenuEntity.ActivityFlag,
                     DeleteFlag = sysMenuEntity.DeleteFlag,
                     ModuleId = sysMenuEntity.ModuleId,
                     FuncPointId = sysMenuEntity.FuncPointId,
                     ModuleName = sysModuleEnumEntity == null ? "-" : sysModuleEnumEntity.Description,
                     FuncPointName = sysFuncPointEnumEntity == null ? "-" : sysFuncPointEnumEntity.Description,
                 };
     var list = query.ToList<SysMenuEntity>();
     return list;
 }