public void GetQuestions(QuizSettings quiz)
        {
            QuizBusinessLayer quizbusinesslayer = new QuizBusinessLayer();

            quiz.Name = Request.Cookies["QuizName"].Value;
            List <QuizSettings> QuizQuestions = quizbusinesslayer.GetQuestionsForUpdate(quiz.Name);

            ViewBag.QuestionCreated = "Created";
            ViewBag.ListOfQues      = QuizQuestions;
            ViewBag.DisableSettings = "Disable";
        }
        public void UpdateQuestionAndAnswers(QuizSettings quiz)
        {
            QuizBusinessLayer quizbusinesslayer = new QuizBusinessLayer();

            quiz.CorrectAnswer = Request.Form["radiog_lite"];
            quizbusinesslayer.UpdateQuestionAndANswers(quiz);
            List <QuizSettings> QuizQuestions = quizbusinesslayer.GetQuestionsForUpdate(quiz.Name);

            ViewBag.QuestionCreated = "Created";
            ViewBag.ListOfQues      = QuizQuestions;
            ViewBag.DisableSettings = "Disable";
        }
 public void SaveQuestionAndAnswers(QuizSettings quiz)
 {
     quiz.CorrectAnswer = Request.Form["radiog_lite"];
     quiz.Name          = Request.Form["Name"];
     if (quiz.Question != null && quiz.Answer1 != null && quiz.Answer2 != null && quiz.Answer3 != null && quiz.Answer4 != null && quiz.CorrectAnswer != null && quiz.Points != null)
     {
         QuizBusinessLayer quizbusinesslayer = new QuizBusinessLayer();
         quizbusinesslayer.InsertQuestionAnswers(quiz);
         List <QuizSettings> QuizQuestions = quizbusinesslayer.GetQuestionsForUpdate(quiz.Name);
         ViewBag.QuestionCreated = "Created";
         ViewBag.ListOfQues      = QuizQuestions;
         ViewBag.DisableSettings = "Disable";
     }
     else
     {
         ViewBag.DisableSettings = "Disable";
         ViewBag.QuestionCreated = "Created";
         ViewBag.QuesAnswerError = "QandA Missing";
     }
 }