Exemplo n.º 1
0
        public async Task <bool> CheckUserExist(int userId, int committeeId)
        {
            var result = await _committeeQueries.GetAssignedUserByIdAndCommittee(userId, committeeId);

            if (result != null)
            {
                throw new BusinessRuleException(Resources.CommitteeResources.ErrorMessages.UserAlreadyExist);
            }
            return(true);
        }
Exemplo n.º 2
0
        public async Task RemoveAssignedUser(int userId, int commiteeId)
        {
            var user = await _committeeQueries.GetAssignedUserByIdAndCommittee(userId, commiteeId);

            Check.ArgumentNotNull(nameof(user), user);
            user.DeActive();
            _genericCommandRepository.Update(user);
            await _genericCommandRepository.SaveAsync();

            if (!string.IsNullOrEmpty(user.UserProfile.Email) || !string.IsNullOrEmpty(user.UserProfile.Mobile))
            {
                await _notificationAppService.SendNotificationByEmailAndSmsForRolesChanged(user.UserProfile.Id, user.UserProfile.Email, user.UserProfile.Mobile);
            }
        }