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

            db.TrafficSignLocations.Remove(trafficSignLocation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TrafficSignLocationID,TrafficSignID,TSLocationStartLatitude,TSLocationStartLongitude,TSLocationEndLatitude,TSLocationEndLongitude")] TrafficSignLocation trafficSignLocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trafficSignLocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TrafficSignID = new SelectList(db.TrafficSigns, "TrafficSignID", "TrafficSignName", trafficSignLocation.TrafficSignID);
     return(View(trafficSignLocation));
 }
コード例 #3
0
        public IHttpActionResult GetTrafficSignLocation(int id)
        {
            TrafficSignLocation trafficSignLocation = db.TrafficSignLocations.Find(id);

            if (trafficSignLocation == null)
            {
                return(NotFound());
            }

            return(Ok(trafficSignLocation));
        }
コード例 #4
0
        public ActionResult Add([Bind(Include = "TrafficSignLocationID,TrafficSignID,TSLocationStartLatitude,TSLocationStartLongitude,TSLocationEndLatitude,TSLocationEndLongitude")] TrafficSignLocation trafficSignLocation)
        {
            if (ModelState.IsValid)
            {
                db.TrafficSignLocations.Add(trafficSignLocation);
                db.SaveChanges();
                return(RedirectToAction("Add"));
            }

            ViewBag.TrafficSignID = new SelectList(db.TrafficSigns, "TrafficSignID", "TrafficSignName", trafficSignLocation.TrafficSignID);
            return(View(trafficSignLocation));
        }
コード例 #5
0
        // GET: TrafficSignLocations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TrafficSignLocation trafficSignLocation = db.TrafficSignLocations.Find(id);

            if (trafficSignLocation == null)
            {
                return(HttpNotFound());
            }
            return(View(trafficSignLocation));
        }
コード例 #6
0
        // GET: TrafficSignLocations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TrafficSignLocation trafficSignLocation = db.TrafficSignLocations.Find(id);

            if (trafficSignLocation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TrafficSignID = new SelectList(db.TrafficSigns.OrderBy(ts => ts.TrafficSignName), "TrafficSignID", "TrafficSignName", trafficSignLocation.TrafficSignID);
            return(View(trafficSignLocation));
        }