public ActionResult DeleteConfirmed(int id) { Route_ route_ = db.Route_.Find(id); db.Route_.Remove(route_); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_Route,Departure,Arrival,Date_departure,Date_arrival,ID_Driver")] Route_ route_) { if (ModelState.IsValid) { db.Entry(route_).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_Driver = new SelectList(db.Drivers, "ID_Driver", "FirstLastName", route_.ID_Driver); ViewBag.Arrival = new SelectList(db.Stations, "ID_Station", "Name_Station", route_.Arrival); ViewBag.Departure = new SelectList(db.Stations, "ID_Station", "Name_Station", route_.Departure); return(View(route_)); }
public ActionResult Details(int?id, int?routeId, int?departure, int?arrival, string DateArrival) { if (routeId == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Route_ route_ = db.Route_.Find(id); if (route_ == null) { return(HttpNotFound()); } return(View(route_)); }
// GET: Route_/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Route_ route_ = db.Route_.Find(id); if (route_ == null) { return(HttpNotFound()); } return(View(route_)); }
// GET: Route_/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Route_ route_ = db.Route_.Find(id); if (route_ == null) { return(HttpNotFound()); } ViewBag.ID_Driver = new SelectList(db.Drivers, "ID_Driver", "FirstLastName", route_.ID_Driver); ViewBag.Arrival = new SelectList(db.Stations, "ID_Station", "Name_Station", route_.Arrival); ViewBag.Departure = new SelectList(db.Stations, "ID_Station", "Name_Station", route_.Departure); return(View(route_)); }
public ActionResult Details_Ticket([Bind(Include = "ID_Route,Departure,Arrival,DateArrival")] Route_ rout) { if (ModelState.IsValid) { db.Route_.Add(rout); db.SaveChanges(); return(RedirectToAction("Details_Ticket")); } ViewBag.Arrival = new SelectList(db.Stations, "ID_Station", "Name_Station", rout.Arrival); ViewBag.Departure = new SelectList(db.Stations, "ID_Station", "Name_Station", rout.Departure); ViewBag.Date_Route = new SelectList(db.Route_Station, "ID_Route", "ID_Date_Route", rout.DateArrival); return(View(rout)); }