Example #1
0
        public bool DeleteTrue(IList <int> idList, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
        {
            var res = false;

            if (idList != null && idList.Count > 0)
            {
                var delete = roleRespoitory.GetList(e => idList.Contains(e.Id)).ToList();
                if (delete != null && delete.Count > 0)
                {
                    res = DeleteTrue(delete, operUser);
                }
            }
            return(res);
        }
Example #2
0
        public IQueryable <iPow.Infrastructure.Crosscutting.Authorize.Dto.UserRoleDto> GetUserRoleDtoList()
        {
            var res = userRoleRepository.GetList().Select(e => new iPow.Infrastructure.Crosscutting.Authorize.Dto.UserRoleDto()
            {
                Id       = e.Id,
                RoleID   = e.RoleID,
                UserID   = e.UserID,
                UserName = adminUserRepository.GetList(d => d.id == e.UserID).FirstOrDefault() != null ?
                           adminUserRepository.GetList(d => d.id == e.UserID).FirstOrDefault().username : "******",
                RoleName = rolesRepository.GetList(r => r.RoleID == e.RoleID).FirstOrDefault() != null ?
                           rolesRepository.GetList(r => r.RoleID == e.RoleID).FirstOrDefault().Description : "暂无角色"
            }).AsQueryable();

            return(res);
        }
Example #3
0
        public IQueryable <iPow.Infrastructure.Crosscutting.Authorize.Dto.UserRoleDto> GetUserRoleDtoList()
        {
            var res = (from userRole in userRoleRepository.GetList()
                       join user in adminUserRepository.GetList() on userRole.UserID equals user.id
                       join role in rolesRepository.GetList() on userRole.RoleID equals role.RoleID
                       select new iPow.Infrastructure.Crosscutting.Authorize.Dto.UserRoleDto
            {
                Id = userRole.Id,
                RoleID = userRole.RoleID,
                RoleName = role.Description,
                UserID = userRole.UserID,
                UserName = user.username
            });

            //userRoleRepository.GetList().Select(e => new iPow.Infrastructure.Crosscutting.Authorize.Dto.UserRoleDto()
            //{
            //    Id = e.Id,
            //    RoleID = e.RoleID,
            //    UserID = e.UserID,
            //    UserName = adminUserRepository.GetList().Where(d => d.id == e.UserID).FirstOrDefault() != null ?
            //    adminUserRepository.GetList().Where(d => d.id == e.UserID).FirstOrDefault().username : "******",
            //    //adminUserRepository.GetList(d => d.id == e.UserID).FirstOrDefault() != null ?
            //    //adminUserRepository.GetList(d => d.id == e.UserID).FirstOrDefault().username : "******",
            //    RoleName = rolesRepository.GetList().Where(r => r.RoleID == e.RoleID).FirstOrDefault() != null ?
            //    rolesRepository.GetList().Where(r => r.RoleID == e.RoleID).FirstOrDefault().Description : "暂无角色"
            //}).AsQueryable();
            return(res);
        }
Example #4
0
        public bool Delete(List <int> roleIdList)
        {
            var deleteModel = roleRespoitory.GetList(e => roleIdList.Contains(e.Id));

            foreach (var item in deleteModel)
            {
                roleRespoitory.Delete(item);
            }
            var res = false;

            try
            {
                roleRespoitory.Uow.Commit();
            }
            catch (Exception ex)
            {
            }
            return(res);
        }