예제 #1
0
        public IActionResult ConfirmActive(int id)
        {
            var user = ctx.FindUser(id);

            ctx.ActiveUser(user);
            return(RedirectToAction(nameof(ListAllUser)));
        }
        public void ActiveUser(UserModel usermodel)
        {
            var UserStatus = userRepository.GetById(usermodel.UserId);

            UserStatus.IsActive = usermodel.IsActive;
            Mapper.Initialize(a => { a.CreateMap <UserModel, User>(); });
            var user = Mapper.Map <User>(UserStatus);

            userRepository.ActiveUser(user);
        }
예제 #3
0
        public async Task <ApiResponse> ActiveUser(Int64 user_id)
        {
            var response = new ApiResponse();
            var data     = await _repository.ActiveUser(user_id);

            response.Data    = data.Data;
            response.Message = data.Message;
            response.Status  = data.Status;

            return(response);
        }
예제 #4
0
 public async Task <ActionResult> ActiveUser(UserModel um)
 {
     try
     {
         um.U_Role = 1;
         return(new JsonResult(await _userrepo.ActiveUser(um)));
     }
     catch (Exception ex)
     {
         _logger.LogError("Erro in user controller", ex);
         return(new JsonResult(ResponseModel.ServerInternalError(data: ex)));
     }
 }
        public override async Task <int> HandleCommand(ActiveUserPasswordCommand request, CancellationToken cancellationToken)
        {
            var user = await userQueries.GetUser(request.UserName);

            if (user.IsActived)
            {
                throw new BusinessException("ActivedAccount");
            }
            if (user != null)
            {
                return(await userRepository.ActiveUser(user.Id, (request.Password + user.SecurityPassword.ToString()).CalculateMD5Hash()));
            }
            throw new BusinessException("NotExistedAccount");
        }
예제 #6
0
파일: UserService.cs 프로젝트: wyh0395/AMS
 public ResModel ActiveUser(UserDto userDto, UserDto operationUser)
 {
     return(_userRepository.ActiveUser(userDto, operationUser));
 }