Пример #1
0
 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);
 }
Пример #2
0
 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);
 }
Пример #3
0
 private void CheckForTimerException(Quiz quiz)
 {
     if (quiz.IsTimerBased)
     {
         if (!quiz.TimerTime.HasValue)
         {
             throw new Exception(errorMessage);
         }
     }
 }