public ActionResult DeleteConfirmed(int id) { RealtyListingModel realtyListingModel = db.RealtyListingModels.Find(id); db.RealtyListingModels.Remove(realtyListingModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MLSID,StreetAddressLine1,StreetAddressLine2,StreetAddressCity,StreetAddressState,StreetAddressZipCode,StreetAddressNeighborhood,SalePrice,InitialListingDate,BedroomCount,Pictures,GarageSizeSquareFeet,HouseSizeSquareFeet,LotSizeSquareFeet,Description")] RealtyListingModel realtyListingModel) { if (ModelState.IsValid) { db.Entry(realtyListingModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(realtyListingModel)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RealtyListingModel realtyListingModel = db.RealtyListingModels.Find(id); if (realtyListingModel == null) { return(HttpNotFound()); } return(View(realtyListingModel)); }