public ActionResult Create(CreateViewModel createViewModel) { if (!ModelState.IsValid) { return View(createViewModel); } var selectedQuestionGroup = QuestionGroupService.FindById(createViewModel.DropDownList_QuestionGroup_Property.SelectedQuestionGroup); var question = new Question() { Content = createViewModel.Content, QuestionGroup = selectedQuestionGroup, QuestionGroupId = createViewModel.DropDownList_QuestionGroup_Property.SelectedQuestionGroup != -1 ? (int?)createViewModel.DropDownList_QuestionGroup_Property.SelectedQuestionGroup : null, }; QuestionService.CreateQuestion(question); TempData["QuestionId"] = question.QuestionId; TempData["QuestionName"] = question.Content; TempData["Message"] = QuestionsMessage.CreateSuccess; return Redirect(Url.Content("~/feedback/questions/index")); }
public void UpdateQuestion(Question question) { QuestionRepository.Update(question); SaveQuestion(); }
public void DeleteQuestion(Question question) { QuestionRepository.Delete(question); SaveQuestion(); }
public void CreateQuestion(Question question) { QuestionRepository.Add(question); SaveQuestion(); }