public ActionResult Questions() { QuestionMaster question = new QuestionMaster(); question.LoggedInUser = long.Parse("0" + Request.Cookies["UserId"].Value); List <QuestionMaster> questionList = objExamBL.CRUDQuestions(question, "L"); return(View(questionList)); }
public List <SelectListItem> GetQuestionListItem(int courseId) { ExamBL objExamBL = new ExamBL(); List <SelectListItem> lstSelectItem = new List <SelectListItem>(); try { QuestionMaster obj = new QuestionMaster(); obj.CourseId = courseId; List <QuestionMaster> lstUserType = objExamBL.CRUDQuestions(obj, "Q"); if (lstUserType != null) { lstSelectItem.Add(new SelectListItem { Text = "Select Question", Value = "" }); foreach (var u in lstUserType) { lstSelectItem.Add(new SelectListItem { Text = Convert.ToString(u.Question), Value = Convert.ToString(u.QuestionId) }); } } } catch (Exception) { throw; } return(lstSelectItem); }