public ActionResult ResetPassword(MerchantResetPasswordModel WebData) { if (WebData.Password != WebData.SecondPassword) { ModelState.AddModelError("SecondPassword", "The verify is not matching the Password"); } if (ModelState.IsValid) { // Attempt to modify the password try { bool createStatus = MerchantServiceInstance.ResetMerchantPassword(WebData); if (createStatus == true) { return(RedirectToAction("SelectMerchantForEdit")); } else { ModelState.AddModelError("", "Failed to reset the merchant password"); } } catch (Exception Ex) { ModelState.AddModelError("", Common.StandardExceptionErrorMessage(Ex)); } } // If we got this far, something failed, redisplay form return(View(WebData)); }
public ActionResult ResetPassword(int id) { MerchantResetPasswordModel ToShow = new MerchantResetPasswordModel(); ToShow.Password = MerchantServiceInstance.SuggestMerchantPassword(); ToShow.SecondPassword = ToShow.Password; ToShow.ID = Convert.ToString(id); return(View(ToShow)); }