public IActionResult CreateHomeListing(HomeListing homeListing) { if (ModelState.IsValid) { homeListingRepository.Add(homeListing); return(RedirectToAction("AgentHomeListingView")); } return(View()); }
public IActionResult EditHomeListing(HomeListing changeedHome) { if (ModelState.IsValid) { homeListingRepository.Update(changeedHome); return(RedirectToAction("AgentHomeListingView")); } return(View()); }
public IActionResult Details(int id) { HomeListing hlDetails = homeListingRepository.GetAHomeListing(id); int AgentId = hlDetails.AgentId; User userDetails = userRepository.GetUserById(AgentId); ViewBag.userData = userDetails; return(View(homeListingRepository.GetAHomeListing(id))); }
public ActionResult Delete(HomeListing deleteItem) { homeListingRepository.Delete(deleteItem); return(RedirectToAction("AgentHomeListingView")); }