public ActionResult Change(ChangeInput input, FormButton cancel) { if (cancel) return HttpSeeOther(this.Url.Action("", "~Account")); this.ViewData.Model = new ChangeViewModel(input); if (!this.ModelState.IsValid) return View().WithStatus(HttpStatusCode.BadRequest); var result = ChangeImpl(input); if (result.IsError) return View().WithErrors(result); return HttpSeeOther(this.Url.Action(Saved)); }
public ActionResult Change(ChangeInput input, FormButton cancel) { if (cancel) { return Redirect(this.Url.Action("", "~Account")); } this.ViewData.Model = new ChangeViewModel(input); if (!this.ModelState.IsValid) { return View().WithStatus(HttpStatusCode.BadRequest); } var result = this.changer.Change(input); if (result.IsError) { return View().WithErrors(result); } if (result.StatusCode == HttpStatusCode.Accepted) { this.TempData["PostChange"] = result; return Redirect(this.Url.Action(VerificationSent)); } return Redirect(this.Url.Action(Saved)); }