| | |
| | | from c in _channleRepository.Where(s => s.ChannlesNum == uc.ChannleId) |
| | | select new UserChannleDto |
| | | { |
| | | Id = c.ChannlesNum, |
| | | Id = c.Id, |
| | | ChannlesNum = c.ChannlesNum, |
| | | Name = c.ChannlesName, |
| | | }, |
| | | Remark = u.Remark, |
| | |
| | | List<UserChannle> userChannles = new List<UserChannle>(); |
| | | foreach (var item in input.ChannlesId) |
| | | { |
| | | var channleNum = item; |
| | | if (IsGuid(channleNum)) |
| | | { |
| | | channleNum = await _channleRepository.Where(x => x.Id == Guid.Parse(item)).Select(s => s.ChannlesNum).FirstOrDefaultAsync(); |
| | | } |
| | | |
| | | userChannles.Add(new UserChannle() |
| | | { |
| | | Id = Guid.NewGuid(), |
| | | ChannleId = item, |
| | | ChannleId = channleNum, |
| | | UserId = entity.Id |
| | | }); |
| | | } |
| | |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(result != Constant.SUCCESS, |
| | | CustomeErrorMessage.ResetPasswordFail); |
| | | } |
| | | |
| | | public async Task<int> DeleteBackClientUser(Guid id) |
| | | { |
| | | var entity = await _userRepository.FirstOrDefaultAsync(s => s.Id == id && s.ClientId == Constant.ClientType.Back); |
| | |
| | | |
| | | public async Task<Guid> CreateRole(CreateOrUpdateRoleInput input) |
| | | { |
| | | var entity = ObjectMapper.Map<CreateOrUpdateRoleInput, Role>(input); |
| | | return await _roleRepository.InsertAndGetIdAsync(entity); |
| | | Role role = new Role() |
| | | { |
| | | Id = input.Id, |
| | | Name = input.Name, |
| | | Sequence = input.Sequence, |
| | | DepartmentId = input.DepartmentId, |
| | | DataRange = input.DataRange, |
| | | Remark = input.Remark |
| | | }; |
| | | return await _roleRepository.InsertAndGetIdAsync(role); |
| | | } |
| | | |
| | | public async Task<PageOutput<RoleInfo>> GetRoles(GetRolesInput input) |
| | |
| | | await _roleRepository.DeleteAsync(id); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | private bool IsGuid(string input) |
| | | { |
| | | Guid guidOutput; |
| | | return Guid.TryParse(input, out guidOutput); |
| | | } |
| | | } |
| | | } |
| | | } |