private List<SysPageFuncPointEntity> SetSysPageFuncPointListCache()
 {
     var listSysPageFuncPointEntity = EntityExecution.ReadEntityList2<SysPageFuncPointEntity>(null).OrderBy(n => n.PageUrl);
     var listSysFuncPointEnumEntity = new SysFuncPointEnumBiz().GetSysFuncPointEnumList();
     var query = from sysPageFuncPointEntity in listSysPageFuncPointEntity
                 join sysFuncPointEnumEntity in listSysFuncPointEnumEntity on sysPageFuncPointEntity.FuncPointId equals sysFuncPointEnumEntity.Name
                 select new SysPageFuncPointEntity()
                 {
                     PageUrl = sysPageFuncPointEntity.PageUrl,
                     FuncPointId = sysPageFuncPointEntity.FuncPointId,
                     FuncPointName = sysFuncPointEnumEntity.Description,
                 };
     var list = query.ToList<SysPageFuncPointEntity>();
     DataCache.SetCache(CacheKey, list);
     return list;
 }
 private List<SysRelationEntity> SetSysRelationListCache()
 {
     var listSysRelationEntity = EntityExecution.ReadEntityList2<SysRelationEntity>(null);
     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(SysEnumNameExtensionBiz.GetDescription<SysFuncPointEnum>(s));
                 }
             }
             if (sysRelationEntity.PermissionListName.Count > 0)
                 sysRelationEntity.PermissionsName = string.Join(",", sysRelationEntity.PermissionListName.ToArray());
         }
     }
     DataCache.SetCache(CacheKey, listSysRelationEntity);
     return listSysRelationEntity;
 }
Esempio n. 3
0
 private List<SysMenuEntity> GetSysMenuDetailList(int? menuId = null)
 {
     var listSysMenuEntity = Dao.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 ? string.Empty : sysModuleEnumEntity.Description,
                     FuncPointName = sysFuncPointEnumEntity == null ? string.Empty : sysFuncPointEnumEntity.Description,
                 };
     var list = query.ToList<SysMenuEntity>();
     return list;
 }