Пример #1
0
        public IActionResult ActiveUser(int Id)
        {
            var user     = _userService.ActiveUser(Id);
            var userDtos = _mapper.Map <UserDto>(user);

            return(Ok(userDtos));
        }
        public IActionResult Activation(string token)
        {
            var user_id = _tokenService.DecodeJwtToken(token);

            if (!string.IsNullOrEmpty(user_id))
            {
                if (Convert.ToInt32(user_id) == 0)
                {
                    TempData["ErrorMessage"] = "Unauthorized token has been access.";

                    return(View());
                }

                var userDetail = _userService.ActiveUser(Convert.ToInt32(user_id));

                if (userDetail.Result.Status)
                {
                    TempData["SuccessMessage"] = userDetail.Result.Message;
                }
                else
                {
                    TempData["ErrorMessage"] = userDetail.Result.Message;
                }
            }

            return(View());
        }
Пример #3
0
        public IActionResult Active([FromQuery] string email, [FromQuery] string token, [FromQuery] string forgot)
        {
            var result = _userService.ActiveUser(email, token);
            var model  = new UserViewModel()
            {
                Email              = email,
                ActiveCode         = result ? token : "xx",
                ComeFromActiveLink = forgot == "N" ? true : false,
                ComeFromForgotLink = forgot == "S" ? true : false
            };

            return(View("~/views/pageaccount/index.cshtml", model));
        }
Пример #4
0
        public ActionResult ActiveUser(UserDto userDto)
        {
            var currentUser = Session["LogUser"] as UserDto;

            return(Json(_userService.ActiveUser(userDto, currentUser)));
        }
 public JsonResult ActiveUser(UserModel usermodel)
 {
     userService.ActiveUser(usermodel);
     return(Json(true, JsonRequestBehavior.AllowGet));
 }