Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DatesBookedTrucks datesBookedTrucks = db.DatesBookedTrucks.Find(id);

            db.DatesBookedTrucks.Remove(datesBookedTrucks);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "TrucKey,TruckID,PickUpDate,DropOffDate")] DatesBookedTrucks datesBookedTrucks)
 {
     if (ModelState.IsValid)
     {
         db.Entry(datesBookedTrucks).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TruckID = new SelectList(db.NewTrucks, "TruckId", "make", datesBookedTrucks.TruckID);
     return(View(datesBookedTrucks));
 }
Exemplo n.º 3
0
        // GET: DatesBookedTrucks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DatesBookedTrucks datesBookedTrucks = db.DatesBookedTrucks.Find(id);

            if (datesBookedTrucks == null)
            {
                return(HttpNotFound());
            }
            return(View(datesBookedTrucks));
        }
Exemplo n.º 4
0
        // GET: DatesBookedTrucks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DatesBookedTrucks datesBookedTrucks = db.DatesBookedTrucks.Find(id);

            if (datesBookedTrucks == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TruckID = new SelectList(db.NewTrucks, "TruckId", "make", datesBookedTrucks.TruckID);
            return(View(datesBookedTrucks));
        }