public ActionResult CreateQuestion(Question crumbsmodel) { if (ModelState.IsValid) { try { crumbsRepository.InsertOrUpdateQuestion(crumbsmodel); crumbsRepository.Save(); } catch (Exception ex) { Console.WriteLine("Exception is:" + ex.ToString()); } return RedirectToAction("Questions"); } return View(crumbsmodel); }
public ActionResult EditQuestion(Question crumbsmodel) { if (ModelState.IsValid && crumbsmodel.QuestionID > 0) { crumbsRepository.InsertOrUpdateQuestion(crumbsmodel); crumbsRepository.Save(); return RedirectToAction("Questions"); } return View(crumbsmodel); }
public ActionResult CreateQuestion() { Question crumbsmodel = new Question(); return View(crumbsmodel); }