Beispiel #1
0
        public async ValueTask <IActionResult> LoadChangePasswordPartialViewAsync(long userId, string userName)
        {
            ChangeUserAccountPasswordViewModel changeUserAccountPasswordVM = new ChangeUserAccountPasswordViewModel();

            changeUserAccountPasswordVM.UserId   = userId;
            changeUserAccountPasswordVM.UserName = userName;

            return(await Task.Run(() => this.PartialView("_ChangeUserAccountPassword", changeUserAccountPasswordVM)));
        }
Beispiel #2
0
        public async ValueTask <IActionResult> ChangeUserAccountPasswordAsync([FromForm] ChangeUserAccountPasswordViewModel changeUserAccountPasswordVM)
        {
            dynamic ajaxReturn = new JObject();
            User    user       = new User();

            user = this._mapper.Map <User>(changeUserAccountPasswordVM);

            var isUpdateSuccess = await this._userManagementService.ChangeUserAccountPasswordAsync(user);

            if (isUpdateSuccess)
            {
                ajaxReturn.Status  = "Success";
                ajaxReturn.Message = "Password changed successfully";
            }
            else
            {
                ajaxReturn.Status  = "Error";
                ajaxReturn.Message = "Error occured";
            }

            return(this.Json(ajaxReturn));
        }