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