Esempio n. 1
0
        public IActionResult Delete(int?Id)
        {
            var user = _Question.GetQuestionById(Id);

            if (user == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View(user));
        }
Esempio n. 2
0
        /// <summary>
        /// Return question
        /// </summary>
        /// <returns>Question</returns>
        public JsonResult ListQuestion()
        {
            List <int> QuestionIds = Session["QuestionIds"] as List <int>;

            if (QuestionIds.Count > 0)
            {
                int id = QuestionIds[0];
                QuestionIds.RemoveAt(0);
                Session["QuestionIds"] = QuestionIds;
                int questionCount  = int.Parse(Session["QuestionCount"].ToString());
                int questionNumber = int.Parse(Session["QuestionNumber"].ToString());
                var question       = questionImpl.GetQuestionById(id);
                var quest          = new { QuestionNumber = questionNumber, QuestionCount = questionCount, Question = question };
                Session["QuestionNumber"] = questionNumber + 1;
                return(Json(quest, JsonRequestBehavior.AllowGet));
            }
            return(null);
        }
Esempio n. 3
0
        public void GetQuestionById(int questionId)
        {
            Question question = _questionImpl.GetQuestionById(1);

            Assert.IsNotNull(question);
        }
Esempio n. 4
0
 public static QuestionInfo GetQuestionById(int id)
 {
     return(dal.GetQuestionById(id));
 }