Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DatesBookedTrailer datesBookedTrailer = db.DatesBookedTrailers.Find(id);

            db.DatesBookedTrailers.Remove(datesBookedTrailer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        // 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));
        }
Esempio n. 4
0
        // 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));
        }