public ActionResult DeleteConfirmed(int id) { tblRide tblRide = db.tblRides.Find(id); db.tblRides.Remove(tblRide); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }