Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public ActionResult EditQuestion(Question crumbsmodel)
 {
     if (ModelState.IsValid && crumbsmodel.QuestionID > 0)
     {
         crumbsRepository.InsertOrUpdateQuestion(crumbsmodel);
         crumbsRepository.Save();
         return RedirectToAction("Questions");
     }
     return View(crumbsmodel);
 }
Esempio n. 3
0
 public ActionResult CreateQuestion()
 {
     Question crumbsmodel = new Question();
     return View(crumbsmodel);
 }