Exemplo n.º 1
0
 /// <summary>
 /// 用户组列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable<RoleEntity> GetList()
 {
     var cacheList = CacheFactory.GetCacheInstance().GetListCache<RoleEntity>(busines.CacheKey, out long toatl);
     if (cacheList == null || cacheList.Count == 0)
     {
         cacheList = busines.GetUserGroupList().ToList();
         CacheFactory.GetCacheInstance().WriteListCache<RoleEntity>(cacheList, busines.CacheKey);
     }
     return cacheList;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 用户组列表
        /// </summary>
        /// <returns></returns>
        public IEnumerable <RoleEntity> GetList()
        {
            var cacheList = CacheFactory.GetCache().Get <List <RoleEntity> >(busines.CacheKey);

            if (cacheList == null || cacheList.Count == 0)
            {
                cacheList = busines.GetUserGroupList().ToList();
                CacheFactory.GetCache().Add(busines.CacheKey, cacheList);
            }
            return(cacheList);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 用户组列表
        /// </summary>
        /// <returns></returns>
        public IEnumerable <RoleEntity> GetList()
        {
            List <RoleEntity> cacheList = CacheFactory.CacheFactory.GetCacheInstance().GetCache <List <RoleEntity> >(_userGroupBll.CacheKey);

            if (cacheList == null)
            {
                cacheList = _userGroupBll.GetUserGroupList().ToList();
                CacheFactory.CacheFactory.GetCacheInstance().WriteCache(cacheList, _userGroupBll.CacheKey);
            }
            return(cacheList);
        }
Exemplo n.º 4
0
        protected void GetUserGroupList()
        {
            UserGroupBLL userGroup = new UserGroupBLL();

            try
            {
                DataTable dt = userGroup.GetUserGroupList();
                userGroupListGridView.DataSource = dt;
                userGroupListGridView.DataBind();

                if (dt.Rows.Count < 1)
                {
                    msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = "";
                }
            }
            catch (Exception ex)
            {
                msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                userGroup = null;
            }
        }