public ActionResult Update(int id) { var house = HousesManager.GetByID(id); var viewModel = new HouseUpdateResponseViewModel(house); return(View("~/Views/Houses/AddOrUpdate.cshtml", viewModel)); }
public ActionResult Details(int id) { var house = HousesManager.GetByID(id); if (house == null) { return(RedirectToAction("Index")); } var viewModel = new HouseDetailsViewModel(house); return(View(viewModel)); }
public ActionResult Update(int id, HouseUpdateRequestViewModel requestModel) { var house = HousesManager.GetByID(id); requestModel.UpdateHouseModel(house); bool success = HousesManager.Save(house); var viewModel = new HouseUpdateResponseViewModel(house); viewModel.UpdateSuccess = success; return(View("~/Views/Houses/AddOrUpdate.cshtml", viewModel)); }