public ActionResult DeleteConfirmed(int id) { DatesBookedTrailer datesBookedTrailer = db.DatesBookedTrailers.Find(id); db.DatesBookedTrailers.Remove(datesBookedTrailer); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TraiKey,TrailID,PickUpDate,DropOffDate")] DatesBookedTrailer datesBookedTrailer) { if (ModelState.IsValid) { db.Entry(datesBookedTrailer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TrailID = new SelectList(db.NewTrailers, "TrailerId", "reg", datesBookedTrailer.TrailID); return(View(datesBookedTrailer)); }
// GET: DatesBookedTrailers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DatesBookedTrailer datesBookedTrailer = db.DatesBookedTrailers.Find(id); if (datesBookedTrailer == null) { return(HttpNotFound()); } return(View(datesBookedTrailer)); }
// GET: DatesBookedTrailers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DatesBookedTrailer datesBookedTrailer = db.DatesBookedTrailers.Find(id); if (datesBookedTrailer == null) { return(HttpNotFound()); } ViewBag.TrailID = new SelectList(db.NewTrailers, "TrailerId", "reg", datesBookedTrailer.TrailID); return(View(datesBookedTrailer)); }