private ActionResult HandleTimerException(Exception ex, Quiz quiz) { if (ex.Message == errorMessage) { ModelState.AddModelError(string.Empty, ex.Message); SetViewBagCreate(quiz); return View(quiz); } ModelState.AddModelError(string.Empty, ex.Message); SetViewBagCreate(quiz); return View(quiz); }
private void SetViewBagEdit(Quiz quiz) { ViewBag.CategoryIDList = new SelectList(_repoCat.Get(), "CategoryID", "Name", quiz.CategoryID); ViewBag.LevelIDList = new SelectList(_repoLevel.Get(), "LevelID", "Name", quiz.LevelID); ViewBag.SubCategoryIDList = new SelectList(_repoSubCat.Get(), "SubCategoryID", "Name", quiz.SubCategoryID); }
private void CheckForTimerException(Quiz quiz) { if (quiz.IsTimerBased) { if (!quiz.TimerTime.HasValue) { throw new Exception(errorMessage); } } }