소스 검색

专业开课计划左侧树结构

临城职教中职
zhangli 2 년 전
부모
커밋
3e0726a158
1개의 변경된 파일11개의 추가작업 그리고 6개의 파일을 삭제
  1. +11
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs

+ 11
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs 파일 보기

@@ -18,6 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{ {
private CdDeptService cdDeptService = new CdDeptService(); private CdDeptService cdDeptService = new CdDeptService();


#region 缓存定义
private ICache cache = CacheFactory.CaChe();
private string cacheKey = "Learun_adms_cddept";

#endregion
#region 获取数据 #region 获取数据


public List<TreeModel> GetTree(string parentId) public List<TreeModel> GetTree(string parentId)
@@ -62,12 +67,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{ {
try try
{ {
//List<CdDeptEntity> list = cache.Read<List<CdDeptEntity>>(cacheKey);
//if (list == null)
//{
// list = (List<CdDeptEntity>)cdDeptService.GetList();
// cache.Write<List<CdDeptEntity>>(cacheKey, list, CacheId.company);
//}
List<CdDeptEntity> list = cache.Read<List<CdDeptEntity>>(cacheKey);
if (list == null)
{
list = (List<CdDeptEntity>)cdDeptService.GetList();
cache.Write<List<CdDeptEntity>>(cacheKey, list, CacheId.company);
}
return list; return list;
} }
catch (Exception ex) catch (Exception ex)


불러오는 중...
취소
저장