public ActionResult DeleteConfirmed(int id) { hotelr hotelr = db.hotelrs.Find(id); db.hotelrs.Remove(hotelr); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,nombre,precio,categoria")] hotelr hotelr) { if (ModelState.IsValid) { db.Entry(hotelr).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hotelr)); }
public ActionResult Create([Bind(Include = "Id,nombre,precio,categoria")] hotelr hotelr) { if (ModelState.IsValid) { db.hotelrs.Add(hotelr); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hotelr)); }
// GET: hotelrs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } hotelr hotelr = db.hotelrs.Find(id); if (hotelr == null) { return(HttpNotFound()); } return(View(hotelr)); }