public ActionResult EditForAddress(Address address) { if (_addressService.EditAddress(address)) return RedirectToAction("Index"); FillViewData(address); return View(address); }
public ActionResult Edit(Address address) { if (_addressService.EditAddress(address)) return RedirectToAction("Edit", "User", new { id = address.UserId, area = "Users" }); FillViewData(address); return View(address); }
private void FillViewData(Address address) { if (address != null) ViewData["Streets"] = _addressService.ListStreets(address.Street.StreetId); else ViewData["Streets"] = _addressService.ListStreets(null); }