Exemplo n.º 1
0
        /// <summary>
        /// 获取详细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public PublicResult <RoleDetailApo> GetRoleDetail(GetRoleDetailDto dto)
        {
            Role role = null;

            using (var client = DbFactory.CreateClient())
            {
                role = client.Queryable <Role>().InSingle(dto.Id);
            }
            if (role == null)
            {
                return(Error("找不到数据"));
            }

            var res = new RoleDetailApo
            {
                Id       = role.Id,
                Name     = role.Name,
                IsActive = role.IsActive,
                Code     = role.Code,
                IsAdmin  = role.IsAdmin,
                IsSystem = role.IsSystem
            };

            return(res);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取详细
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ServResult <RoleDetailApo> GetRoleDetail(ServRequest <GetRoleDetailDto> request)
        {
            Role role = null;

            using (var client = DbFactory.GetClient())
            {
                role = client.Queryable <Role>().InSingle(request.Data.Id);
            }
            if (role == null)
            {
                return(Error("找不到数据"));
            }

            var res = new RoleDetailApo
            {
                Id       = role.Id,
                Name     = role.Name,
                IsActive = role.IsActive,
                Code     = role.Code,
                IsAdmin  = role.IsAdmin,
                IsSystem = role.IsSystem
            };

            return(res);
        }