Example #1
0
        /// <summary>
        /// 获得所有菜单列表信息【分页】
        /// </summary>
        /// <returns></returns>
        public List <ModuleEntity> GetList(Pagination pagination)
        {
            var expression = ExtLinq.True <ModuleEntity>();
            ResultClass <List <ModuleEntity> > _ret = service.FindList(expression, pagination);

            if (_ret.Result)
            {
                return(_ret.ResultData.OrderBy(t => t.F_SortCode).ToList());
            }
            return(new List <ModuleEntity>());
        }
Example #2
0
        public List <ModuleEntity> GetList(string roleId)
        {
            cacheKey = cacheKey + "_" + roleId;//拼接有参key值
            var cacheList = cache.GetCache <List <ModuleEntity> >(cacheKey);

            if (cacheList == null)
            {
                string sql = @"select * from Sys_Module t1
                                        left join  Sys_RoleAuthorize t2
                                        on t1.F_Id=t2.F_ItemId
                                        where 1=1
                                        and t1.F_EnabledMark=1
                                        and t2.F_ItemType=1
                                        and t2.F_ObjectType=1 ";
                sql += " and t2.F_ObjectId=@F_ObjectId ";
                sql += " order by t1.F_SortCode asc";

                DbParameter[] parameter =
                {
                    new SqlParameter("@F_ObjectId", roleId)
                };
                cacheList = service.FindList(sql, parameter);
                cache.WriteCache <List <ModuleEntity> >(cacheList, cacheKey, "UserCacheDependency", "Sys_RoleAuthorize");
            }
            return(cacheList);
        }
Example #3
0
        /// <summary>
        /// 使用sql查询
        /// </summary>
        /// <param name="enCode"></param>
        /// <returns></returns>
        public List <ModuleEntity> FildSql(string enCode)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(enCode);
            return(service.FindList(strSql.ToString()).ToList());
        }