public ActionResult DeleteConfirmed(int id) { Healty healty = db.healties.Find(id); db.healties.Remove(healty); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "HealthyId")] Healty healty) { if (ModelState.IsValid) { db.Entry(healty).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(healty)); }
public ActionResult Create([Bind(Include = "HealthyId")] Healty healty) { if (ModelState.IsValid) { db.healties.Add(healty); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(healty)); }
// GET: Healties/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Healty healty = db.healties.Find(id); if (healty == null) { return(HttpNotFound()); } return(View(healty)); }