public ActionResult ChangeAddress(ChangeAddressViewModel model) { if (Validator.IsCanadianPostal(model.NewPostal, out string invalid)) { Customer curr = GetCurrentCustomer(); // make sure we found customer if (curr == null) { ModelState.AddModelError(String.Empty, "Sorry an error occured while trying to find you. Please try log in again."); return(View()); } curr.CustAddress = model.NewAddress; curr.CustCity = model.NewCity; curr.CustProv = model.NewProv; curr.CustCity = model.NewCity; curr.CustPostal = model.NewPostal; curr.CustCountry = model.NewCountry; if (model.Update(curr)) { return(RedirectToAction("Index", new { Message = ManageMessageId.EditAddressSuccess })); } // something went wrong return(RedirectToAction("Index", new { Message = ManageMessageId.Error })); } // made it here, something went wrong with data if (!string.IsNullOrEmpty(invalid)) { ModelState.AddModelError(String.Empty, "Invalid postal code."); } return(View()); }