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