public ActionResult DeleteConfirmed(int id) { TrafficSignLocation trafficSignLocation = db.TrafficSignLocations.Find(id); db.TrafficSignLocations.Remove(trafficSignLocation); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
public IHttpActionResult GetTrafficSignLocation(int id) { TrafficSignLocation trafficSignLocation = db.TrafficSignLocations.Find(id); if (trafficSignLocation == null) { return(NotFound()); } return(Ok(trafficSignLocation)); }
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)); }
// 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)); }
// 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)); }