public ActionResult DeleteConfirmed(int id) { tblChild tblChild = db.tblChilds.Find(id); db.tblChilds.Remove(tblChild); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ChildID,Name,Surname,Grade,Age")] tblChild tblChild) { if (ModelState.IsValid) { db.Entry(tblChild).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblChild)); }
public ActionResult Create([Bind(Include = "ChildID,Name,Surname,Grade,Age")] tblChild tblChild) { if (ModelState.IsValid) { db.tblChilds.Add(tblChild); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblChild)); }
// GET: tblChilds/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblChild tblChild = db.tblChilds.Find(id); if (tblChild == null) { return(HttpNotFound()); } return(View(tblChild)); }