/// <summary> /// Get the view Model to display a Change Password Form and Form result /// </summary> /// <param name="param">Builder params <see cref="GetChangePasswordViewModelParam"/></param> /// <returns> /// The view model to display the Change Password Form /// </returns> protected virtual ChangePasswordViewModel GetChangePasswordViewModel(GetChangePasswordViewModelParam param) { var viewModel = param.Customer != null ? ViewModelMapper.MapTo <ChangePasswordViewModel>(param.Customer, param.CultureInfo) : new ChangePasswordViewModel(); viewModel.Status = param.Status.HasValue ? param.Status.Value.ToString("G") : string.Empty; viewModel.ReturnUrl = param.ReturnUrl; SetPasswordValidationRules(viewModel); return(viewModel); }
/// <summary> /// Get the view Model to display a Change Password Form and Form result /// </summary> /// <param name="param">Builder params <see cref="GetChangePasswordViewModelParam"/></param> /// <returns> /// The view model to display the Change Password Form /// </returns> protected virtual ChangePasswordViewModel GetChangePasswordViewModel(GetChangePasswordViewModelParam param) { var viewModel = param.Customer != null?ViewModelMapper.MapTo <ChangePasswordViewModel>(param.Customer, param.CultureInfo) : new ChangePasswordViewModel(); viewModel.Status = param.Status.HasValue ? param.Status.Value.ToString("G") : string.Empty; viewModel.MinRequiredPasswordLength = MembershipProvider.MinRequiredPasswordLength; viewModel.MinRequiredNonAlphanumericCharacters = MembershipProvider.MinRequiredNonAlphanumericCharacters; viewModel.PasswordRegexPattern = CreatePasswordRegexPattern().ToString(); viewModel.ReturnUrl = param.ReturnUrl; return(viewModel); }