public ActionResult DeleteConfirmed(int id) { JassLatLon jasslatlon = db.JassLatLons.Find(id); db.JassLatLons.Remove(jasslatlon); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /LatLon/Details/5 public ActionResult Details(int id = 0) { JassLatLon jasslatlon = db.JassLatLons.Find(id); if (jasslatlon == null) { return(HttpNotFound()); } return(View(jasslatlon)); }
// // GET: /LatLon/Edit/5 public ActionResult Edit(int id = 0) { JassLatLon jasslatlon = db.JassLatLons.Find(id); if (jasslatlon == null) { return(HttpNotFound()); } ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID); jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon); return(View(jasslatlon)); }
public ActionResult Edit(JassLatLon jasslatlon) { try { if (ModelState.IsValid) { jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon); db.Entry(jasslatlon).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID); } catch (Exception e) { apiCaller.createBuilderLog("EXCEPTION", "Location", e.Message, new TimeSpan(), false); ViewBag.message = "ERROR when editing"; } return(View(jasslatlon)); }
public ActionResult Create(JassLatLon jasslatlon) { ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID); try { if (ModelState.IsValid) { jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon); db.JassLatLons.Add(jasslatlon); db.SaveChanges(); return(View("Edit", jasslatlon)); } } catch (Exception e) { apiCaller.createBuilderLog("EXCEPTION", "Location", e.Message, new TimeSpan(), false); ViewBag.JassMessage = "ERROR when creating"; } return(View(jasslatlon)); }