예제 #1
0
        public ActionResult Activate(int id)
        {
            if (_userRepository.Activate(id))
            {
                return(RedirectToAction("Index"));
            }

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActivateUserViewModel> Handle(ActivateUserCommand request, CancellationToken cancellationToken)
        {
            var user = await _userRepository.GetUserAsync(request.Id);

            if (user == null)
            {
                return(null);
            }

            await _userRepository.Activate(user);

            return(new ActivateUserViewModel(user.Name, user.Email));
        }
        public IActionResult ActivateUser(int id)
        {
            _loggerManager.Info($"ActivateUser({id}) was requested");

            var result = _userRepository.Activate(id, HttpContext.GetUserId());

            if (result)
            {
                _loggerManager.Info($"ActivateUser({id}) successfully activaed");
            }
            else
            {
                _loggerManager.Warn($"ActivateUser({id}) was unable to activate");
            }

            return(new JsonResult(new { result }));
        }
예제 #4
0
        public async Task <ActionResult> ActivateUser(int id)
        {
            try
            {
                var resultado = await _userRepository.Activate(id);

                if (!resultado)
                {
                    return(BadRequest());
                }
                return(NoContent());
            }
            catch (Exception excepcion)
            {
                return(BadRequest());
            }
        }
예제 #5
0
        public async Task <string> Activate(IUser user)
        {
            string result = string.Empty;

            if (user == null)
            {
                return("User is null");
            }

            var response = await _userRepository.Activate(user);

            if (!string.IsNullOrEmpty(response))
            {
                return($"Request not successful: {response}");
            }

            return(result);
        }
예제 #6
0
        /// <summary>
        /// Method activates selected student
        /// </summary>
        /// <param name="username">name of selected student</param>
        /// <returns>activated student</returns>
        public User Activate(string username)
        {
            var user = _userRepository.Activate(username);

            return(user);
        }
예제 #7
0
 public void Handle(ActivateUser message)
 {
     _userRepository.Activate(message.Token);
 }
예제 #8
0
 public User Activate(User entity)
 {
     return(repository.Activate(entity));
 }
예제 #9
0
 public void Activate(string email)
 {
     _userRepository.Activate(email);
 }