public ActionResult Edit(QuizStyle quizStyle) { if (ModelState.IsValid) { manager.Entry(quizStyle).State = EntityState.Modified; manager.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public ActionResult Create(QuizStyle quizStyle) { if (ModelState.IsValid) { manager.QuizStyles.Add(quizStyle); manager.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
// GET: QuizStyle/Edit/5 public ActionResult Edit(int id) { if (ModelState.IsValid) { QuizStyle quizStyle = manager.QuizStyles.Find(id); ViewBag.QuizStyle = quizStyle; return(View()); } return(HttpNotFound()); }
public ActionResult Delete(int id, FormCollection collection) { try { QuizStyle quizStyle = manager.QuizStyles.Find(id); if (quizStyle != null) { manager.QuizStyles.Remove(quizStyle); manager.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(RedirectToAction("Index")); } }