public IHttpActionResult PutLatLongGroup(int id, LatLongGroup latLongGroup) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != latLongGroup.LatLongGroupID) { return(BadRequest()); } db.Entry(latLongGroup).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LatLongGroupExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { LatLongGroup latLongGroup = db.LatLongGroups.Find(id); db.LatLongGroups.Remove(latLongGroup); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "LatLongGroupID,NorthWestLat,NorthWestLong,SouthEastLat,SouthEastLong")] LatLongGroup latLongGroup) { if (ModelState.IsValid) { db.Entry(latLongGroup).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(latLongGroup)); }
public ActionResult Create([Bind(Include = "LatLongGroupID,NorthWestLat,NorthWestLong,SouthEastLat,SouthEastLong")] LatLongGroup latLongGroup) { if (ModelState.IsValid) { db.LatLongGroups.Add(latLongGroup); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(latLongGroup)); }
public IHttpActionResult GetLatLongGroup(int id) { LatLongGroup latLongGroup = db.LatLongGroups.Find(id); if (latLongGroup == null) { return(NotFound()); } return(Ok(latLongGroup)); }
public IHttpActionResult PostLatLongGroup(LatLongGroup latLongGroup) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LatLongGroups.Add(latLongGroup); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = latLongGroup.LatLongGroupID }, latLongGroup)); }
// GET: LatLongGroups/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LatLongGroup latLongGroup = db.LatLongGroups.Find(id); if (latLongGroup == null) { return(HttpNotFound()); } return(View(latLongGroup)); }
public IHttpActionResult DeleteLatLongGroup(int id) { LatLongGroup latLongGroup = db.LatLongGroups.Find(id); if (latLongGroup == null) { return(NotFound()); } db.LatLongGroups.Remove(latLongGroup); db.SaveChanges(); return(Ok(latLongGroup)); }