コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Route_ route_ = db.Route_.Find(id);

            db.Route_.Remove(route_);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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_));
 }
コード例 #3
0
        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_));
        }
コード例 #4
0
        // 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_));
        }
コード例 #5
0
        // 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_));
        }
コード例 #6
0
        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));
        }