/// <summary> /// 添加角色 /// </summary> /// <param name="entity"></param> public int AddRole(SysRoleEntity entity) { entity.IncludeAll(); int line = this.SysRole.Add(entity); if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_SYSROLE_CACHE); } return line; }
/// <summary> /// 获得所有角色信息 /// </summary> /// <returns></returns> public List<SysRoleEntity> GetList() { List<SysRoleEntity> list = CacheHelper.Get(CacheKey.JOOSHOW_SYSROLE_CACHE) as List<SysRoleEntity>; if (!list.IsNullOrEmpty()) { return list; } SysRoleEntity sysRole = new SysRoleEntity(); sysRole.IncludeAll(); int isDelete = (int)EIsDelete.NotDelete; sysRole.Where(a => a.IsDelete == isDelete); list = this.SysRole.GetList(sysRole); if (!list.IsNullOrEmpty()) { CacheHelper.Insert(CacheKey.JOOSHOW_SYSROLE_CACHE, list); } return list; }