public ActionResult DeleteConfirmed(int id) { SavedInvasive savedInvasive = db.SavedInvasiveSet.Find(id); db.SavedInvasiveSet.Remove(savedInvasive); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SavedInvasiveId,UserId,InvasiveId")] SavedInvasive savedInvasive) { if (ModelState.IsValid) { db.Entry(savedInvasive).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.InvasiveId = new SelectList(db.InvasiveSet, "InvasiveId", "ScientificName", savedInvasive.InvasiveId); return(View(savedInvasive)); }
// GET: SavedInvasives/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SavedInvasive savedInvasive = db.SavedInvasiveSet.Find(id); if (savedInvasive == null) { return(HttpNotFound()); } return(View(savedInvasive)); }
// GET: SavedInvasives/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SavedInvasive savedInvasive = db.SavedInvasiveSet.Find(id); if (savedInvasive == null) { return(HttpNotFound()); } ViewBag.InvasiveId = new SelectList(db.InvasiveSet, "InvasiveId", "ScientificName", savedInvasive.InvasiveId); return(View(savedInvasive)); }