public ActionResult DeleteConfirmed(int id)
        {
            ApproachRouteDetail approachRouteDetail = db.ApproachRouteDetails.Find(id);

            db.ApproachRouteDetails.Remove(approachRouteDetail);
            db.SaveChanges();
            return(RedirectToAction("Index", new { id = approachRouteDetail.ApproachRouteId }));
        }
        // GET: ApproachRouteDetails/Create
        public ActionResult Create(int id)
        {
            ApproachRouteDetail approachRouteDetail = new ApproachRouteDetail {
                ApproachRouteId = id
            };

            ViewBag.ApproachID      = new SelectList(db.Approaches, "ApproachID", "ApproachRouteDescription");
            ViewBag.ApproachRouteId = new SelectList(db.ApproachRoutes, "ApproachRouteId", "RouteName", id);
            return(View(approachRouteDetail));
        }
 public ActionResult Edit([Bind(Include = "RouteDetailID,ApproachRouteId,ApproachOrder,ApproachID")] ApproachRouteDetail approachRouteDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(approachRouteDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = approachRouteDetail.ApproachRouteId }));
     }
     ViewBag.ApproachID      = new SelectList(db.Approaches, "ApproachID", "ApproachRouteDescription", approachRouteDetail.ApproachID);
     ViewBag.ApproachRouteId = new SelectList(db.ApproachRoutes, "ApproachRouteId", "RouteName", approachRouteDetail.ApproachRouteId);
     return(View(approachRouteDetail));
 }
        // GET: ApproachRouteDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ApproachRouteDetail approachRouteDetail = db.ApproachRouteDetails.Find(id);

            if (approachRouteDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(approachRouteDetail));
        }
        // GET: ApproachRouteDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ApproachRouteDetail approachRouteDetail = db.ApproachRouteDetails.Find(id);

            if (approachRouteDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ApproachID      = new SelectList(db.Approaches, "ApproachID", "ApproachRouteDescription", approachRouteDetail.ApproachID);
            ViewBag.ApproachRouteId = new SelectList(db.ApproachRoutes, "ApproachRouteId", "RouteName", approachRouteDetail.ApproachRouteId);
            return(View(approachRouteDetail));
        }