public OptionGroupsController(IOptionGroupService optionGroupService, IOptionService optionService)
 {
     this.optionGroupService = optionGroupService;
     this.optionService      = optionService;
 }
Пример #2
0
        public QuestionService(
            IUowProvider uowProvider,
            IMapper mapper,
            IInputTypeService inputTypeService,
            IOptionGroupService optionGroupService,
            IOptionChoiceService optionChoiceService,
            IQuestionOptionService questionOptionService,
            ISurveyStructureService surveyStructureService

            )
        {
            this.UowProvider          = uowProvider;
            this.Mapper               = mapper;
            this._inputTypeService    = inputTypeService;
            this._optionGroupService  = optionGroupService;
            this._optionChoiceService = optionChoiceService;
            _questionOptionService    = questionOptionService;
            _surveyStructureService   = surveyStructureService;

            inputTypeList          = _inputTypeService.GetAll();
            optionGroupDefinitions = new OptionGroupDefinitions();
            switchQuestionType     = new Dictionary <Type, Action> {
                { typeof(TextQuestionModel), () =>
                  {
                      SaveTextQuestion((TextQuestionModel)baseQuestionModel);
                  } },
                { typeof(TextAreaQuestionModel), () =>
                  {
                      SaveTextAreaQuestion((TextAreaQuestionModel)baseQuestionModel);
                  } },
                { typeof(RadioQuestionModel), () =>
                  {
                      SaveRadioQuestion((RadioQuestionModel)baseQuestionModel);
                  } },
                { typeof(CheckBoxQuesstionModel), () =>
                  {
                      SaveCheckBoxQuestion((CheckBoxQuesstionModel)baseQuestionModel);
                  } },
                { typeof(DropdownQuestionModel), () =>
                  {
                      SaveDropdownQuestion((DropdownQuestionModel)baseQuestionModel);
                  } },
                { typeof(GridRadioQuestionModel), () =>
                  {
                      SaveGridRadioQuestion((GridRadioQuestionModel)baseQuestionModel);
                  } },
            };

            switchUpdateQuestionType = new Dictionary <Type, Action> {
                { typeof(TextQuestionModel), () =>
                  {
                      UpdateTextQuestion((TextQuestionModel)baseQuestionUpdateModel);
                  } },
                { typeof(TextAreaQuestionModel), () =>
                  {
                      UpdateTextAreaQuestion((TextAreaQuestionModel)baseQuestionUpdateModel);
                  } },
                { typeof(RadioQuestionModel), () =>
                  {
                      UpdateRadioQuestion((RadioQuestionModel)baseQuestionUpdateModel);
                  } },
                { typeof(CheckBoxQuesstionModel), () =>
                  {
                      UpdateCheckboxQuestion((CheckBoxQuesstionModel)baseQuestionUpdateModel);
                  } },
                { typeof(DropdownQuestionModel), () =>
                  {
                      UpdateDropdownQuestion((DropdownQuestionModel)baseQuestionUpdateModel);
                  } },
                { typeof(GridRadioQuestionModel), () =>
                  {
                      UpdateGridRadioQuestion((GridRadioQuestionModel)baseQuestionUpdateModel);
                  } },
            };
        }
Пример #3
0
 public QuestionController(IQuestionService questionService, IQuestionTypeService questionTypeService, IOptionGroupService optionGroupService)
 {
     this.questionService     = questionService;
     this.questionTypeService = questionTypeService;
     this.optionGroupService  = optionGroupService;
 }