public ActionResult DeleteConfirmed(int id) { Arthropod arthropod = db.Arthropods.Find(id); db.Arthropods.Remove(arthropod); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Animal,HasFur,Pop,Dietry,ArthropodsID")] Arthropod arthropod) { if (ModelState.IsValid) { db.Entry(arthropod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arthropod)); }
public ActionResult Create([Bind(Include = "Animal,HasFur,Pop,Dietry,ArthropodsID")] Arthropod arthropod) { if (ModelState.IsValid) { db.Arthropods.Add(arthropod); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arthropod)); }
public ActionResult Edit([Bind(Include = "arthropodsID,arthropodsName,arthropodsType,animalSpecies_animalID,DietryType,PopulationNumber")] Arthropod arthropod) { if (ModelState.IsValid) { db.Entry(arthropod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.animalSpecies_animalID = new SelectList(db.animals, "animalID", "animalID", arthropod.animalSpecies_animalID); return(View(arthropod)); }
// GET: Arthropods/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Arthropod arthropod = db.Arthropods.Find(id); if (arthropod == null) { return(HttpNotFound()); } return(View(arthropod)); }
// GET: Arthropods/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Arthropod arthropod = db.Arthropods.Find(id); if (arthropod == null) { return(HttpNotFound()); } ViewBag.animalSpecies_animalID = new SelectList(db.animals, "animalID", "animalID", arthropod.animalSpecies_animalID); return(View(arthropod)); }