// GET: Questions/Create public IActionResult Create(int id) { ViewData["OptionGroupId"] = new SelectList(optionGroupService.GetAll()); ViewData["QuestionTypeId"] = new SelectList(questionTypeService.GetAll()); ViewData["SectionId"] = id; return(View()); }
public ActionResult QuestionAnswers(int questionTypeId) { try { ViewBag.Sections = Mapper.Map <IEnumerable <QuestionTypeVM> >(QuestionTypeService.GetAll().ToList()); ViewBag.Section = QuestionTypeService.Get(questionTypeId).Name; var formDataDTOs = QuestionAnswerService.GetQuestionAnswersByQuestionType(questionTypeId).ToList(); var formDataVMs = Mapper.Map <IEnumerable <FormDataVM> >(formDataDTOs); //IEnumerable<AnswerVM> answerVMs = Mapper.Map<IEnumerable<AnswerVM>>(answerDTOs); return(View(formDataVMs)); } catch (ArgumentNullException) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } }
// GET: QuestionTypes public IActionResult Index() { var questionTypes = questionTypeService.GetAll(); return(View(questionTypes)); }
public SelectList GetQuestionTypeIdSelectList(short?selectedValue = null) { return(new SelectList(QuestionTypeService.GetAll().ToList(), "Id", "Name", selectedValue)); }