예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblRide tblRide = db.tblRides.Find(id);

            db.tblRides.Remove(tblRide);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "RId,Driver,Passenger,RequestLocation,Destination,vehicle,Rent,shift")] tblRide tblRide)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblRide).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Driver    = new SelectList(db.tblDrivers, "DId", "Name", tblRide.Driver);
     ViewBag.Passenger = new SelectList(db.tblPassengers, "PId", "Name", tblRide.Passenger);
     return(View(tblRide));
 }
예제 #3
0
        // GET: tblRides/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblRide tblRide = db.tblRides.Find(id);

            if (tblRide == null)
            {
                return(HttpNotFound());
            }
            return(View(tblRide));
        }
예제 #4
0
        // GET: tblRides/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblRide tblRide = db.tblRides.Find(id);

            if (tblRide == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Driver    = new SelectList(db.tblDrivers, "DId", "Name", tblRide.Driver);
            ViewBag.Passenger = new SelectList(db.tblPassengers, "PId", "Name", tblRide.Passenger);
            return(View(tblRide));
        }