public ActionResult DeleteConfirmed(int id) { GuestCompanion guestCompanion = db.GuestCompanion.Find(id); db.GuestCompanion.Remove(guestCompanion); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "companionID,name,lastName,DOB,email,reservationID")] GuestCompanion guestCompanion) { if (ModelState.IsValid) { db.Entry(guestCompanion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", guestCompanion.reservationID); return(View(guestCompanion)); }
// GET: GuestCompanions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GuestCompanion guestCompanion = db.GuestCompanion.Find(id); if (guestCompanion == null) { return(HttpNotFound()); } return(View(guestCompanion)); }
// GET: GuestCompanions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GuestCompanion guestCompanion = db.GuestCompanion.Find(id); if (guestCompanion == null) { return(HttpNotFound()); } ViewBag.reservationID = new SelectList(db.Reservation, "reservationID", "reservationID", guestCompanion.reservationID); return(View(guestCompanion)); }