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