public ActionResult Update(int id) { var house = HousesManager.GetByID(id); var viewModel = new HouseUpdateResponseViewModel(house); return(View("~/Views/Houses/AddOrUpdate.cshtml", viewModel)); }
public ActionResult Create(HouseUpdateRequestViewModel requestModel) { var house = new House(); requestModel.UpdateHouseModel(house); bool success = HousesManager.Save(house); var viewModel = new HouseUpdateResponseViewModel(house); viewModel.UpdateSuccess = success; return(RedirectToAction("Details", new { id = house.ID })); }
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)); }