12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using Lottomat.Application.Busines.BaseManage;
- using Lottomat.Application.Entity.BaseManage;
- using Lottomat.Cache.Factory;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- namespace Lottomat.Application.Cache
- {
-
-
-
-
-
-
-
- public class RoleCache
- {
- private RoleBLL busines = new RoleBLL();
-
-
-
-
- public IEnumerable<RoleEntity> GetList()
- {
- var cacheList = CacheFactory.Cache().GetCache<IEnumerable<RoleEntity>>(busines.cacheKey);
- if (cacheList == null)
- {
- var data = busines.GetList();
- CacheFactory.Cache().WriteCache(data, busines.cacheKey);
- return data;
- }
- else
- {
- return cacheList;
- }
- }
-
-
-
-
-
- public IEnumerable<RoleEntity> GetList(string organizeId)
- {
- var data = this.GetList();
- if (!string.IsNullOrEmpty(organizeId))
- {
- data = data.Where(t => t.OrganizeId == organizeId);
- }
- return data;
- }
-
-
-
-
-
- public RoleEntity GetEntity(string roleId)
- {
- var data = this.GetList();
- if (!string.IsNullOrEmpty(roleId))
- {
- var d = data.Where(t => t.RoleId == roleId).ToList<RoleEntity>();
- if (d.Count > 0)
- {
- return d[0];
- }
- }
- return new RoleEntity();
- }
- }
- }
|