public ActionResult DeleteConfirmed(int id) { ALLERGEN aLLERGEN = db.ALLERGEN.Find(id); db.ALLERGEN.Remove(aLLERGEN); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AllergenId,ShortName,LongName,ImageURL")] ALLERGEN aLLERGEN) { if (ModelState.IsValid) { db.Entry(aLLERGEN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aLLERGEN)); }
public ActionResult Create([Bind(Include = "AllergenId,ShortName,LongName,ImageURL")] ALLERGEN aLLERGEN) { if (ModelState.IsValid) { db.ALLERGEN.Add(aLLERGEN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aLLERGEN)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ALLERGEN aLLERGEN = db.ALLERGEN.Find(id); if (aLLERGEN == null) { return(HttpNotFound()); } return(View(aLLERGEN)); }