public ActionResult CreateTest(CreateTestViewModel newTest) { if (ModelState.IsValid) { testServices.CreateNewTest(newTest); } return(View()); }
public ActionResult SaveTest(CreateTestViewModel newTest) { newTest.UserId = Convert.ToInt32(Session["CurrentUserID"]); int testId = 0; if (ModelState.IsValid) { testId = testServices.CreateNewTest(newTest); } TempData["TestId"] = testId; return(RedirectToAction("CreateQuestions", "Question")); }