コード例 #1
0
 public QuestionnaireControllerTests()
 {
     #warning hard-coded behaviours of entities in the database
     repository = new QuestionnaireRepository(null);
     service    = new QuestionnaireService(repository);
     controller = new QuestionnaireController(service);
 }
コード例 #2
0
        public QuestionnaireViewModel(IQuestionnaireService questionnaireService, QuestionFactory questionFactory,
                                      IFrameNavigationService navigationService, IFestivalService festivalService, IOfflineService offlineService, IConfiguration config)
        {
            _config = config;
            _questionnaireService = questionnaireService;
            _navigationService    = navigationService;
            _questionFactory      = questionFactory;
            _festivalService      = festivalService;
            _offlineService       = offlineService;

            Initialize((int)_navigationService.Parameter);

            AddedQuestions         = new ObservableCollection <Question>();
            RemovedQuestions       = new ObservableCollection <Question>();
            OpenDeleteCheckCommand = new RelayCommand <Question>(DeleteCommandCheck, _ => offlineService.IsOnline, true);
            AddQuestionCommand     = new RelayCommand(AddQuestion, () => SelectedItem != null, true);
            // DeleteQuestionCommand = new RelayCommand<Question>(DeleteQuestion, _ => offlineService.IsOnline, true);
            DeleteCommand = new RelayCommand(DeleteQuestion, () => offlineService.IsOnline, true);
            DeleteQuestionnaireCommand     = new RelayCommand(DeleteQuestionnaire, () => offlineService.IsOnline, true);
            SaveQuestionnaireCommand       = new RelayCommand(SaveQuestionnaire, () => offlineService.IsOnline, true);
            OpenFileWindowCommand          = new RelayCommand <Question>(OpenFileWindow, HasAnswers);
            AddOptionToQuestion            = new RelayCommand <Question>(AddOption, _ => offlineService.IsOnline, true);
            SelectReferenceQuestionCommand =
                new RelayCommand <ReferenceQuestion>(SelectReferenceQuestion, _ => offlineService.IsOnline, true);
            SetReferenceQuestionCommand =
                new RelayCommand <Question>(SetReferenceQuestion, _ => offlineService.IsOnline, true);

            QuestionList        = (CollectionView)CollectionViewSource.GetDefaultView(_allQuestions());
            QuestionList.Filter = Filter;
        }
コード例 #3
0
 public ChartController()
 {
     employeeService      = new EmployeeServer();
     questionnaireService = new QuestionnaireServer();
     optionService        = new OptionServer();
     questionService      = new QuestionServer();
 }
コード例 #4
0
        public static QuestionnaireTemplate FillNewQuestionnaireWithAnswers(IQuestionnaireService service, int[] answers,
                                                                            DateTime now, int userId)
        {
            GenericError          error;
            QuestionnaireTemplate localizedTemplate = service.GetQuestionnaireTemplate(1, locale, out error,
                                                                                       DateTime.Now, userId);

            Assert.IsTrue(localizedTemplate.QuestionCategories.Count == 7);

            for (int i = 0; i < localizedTemplate.QuestionCategories.Count; i++)
            {
                QuestionCategory q = localizedTemplate.QuestionCategories[i];
                q.CategoryQuestion.QuestionAnwer = new QuestionAnwer {
                    Answer = answers[i]
                };
            }

            localizedTemplate.QuestionCategories.ForEach(
                cq => cq.Questions.ForEach(q => q.QuestionAnwer = new QuestionAnwer {
                Answer = 1
            }));
            localizedTemplate.QuestionCategories[5].Questions[3].QuestionAnwer.Answer = -1;
            service.SubmitAnsweredTemplate(userId, localizedTemplate, now);
            return(localizedTemplate);
        }
コード例 #5
0
 public HomeController(ILogger <HomeController> logger, IQuestionnaireService QuestionnaireService,
                       IUnitOfWork unitOfWork)
 {
     _logger = logger;
     _QuestionnaireService = QuestionnaireService;
     _unitOfWork           = unitOfWork;
 }
コード例 #6
0
 public DrawController(IQuestionnaireService questionnaireService, IInspectionService inspectionService,
                       IConfiguration configurationService)
 {
     _questionnaireService = questionnaireService;
     _inspectionService    = inspectionService;
     _configurationService = configurationService;
 }
コード例 #7
0
        public QuestionnaireController(
            IQuestionnaireService questionnaireService,
            IMapper mapper

            )
        {
            _questionnaireService = questionnaireService;
            _mapper = mapper;
        }
コード例 #8
0
 public QuestionController(IQuestionnaireService questionnaireService, IReponseService reponse, IQuestionService quest, ICategorieService categ,
                           IAnalyseService analyse, IUserService user, IEmailService emailService)
 {
     _questionnaireService = questionnaireService;
     reponseService        = reponse;
     questionService       = quest;
     categorieService      = categ;
     analyseService        = analyse;
     userService           = user;
     _emailService         = emailService;
 }
コード例 #9
0
 public TiersService(
     ILimitsService limitsService,
     ISettingsService settingsService,
     ITierUpgradeService tierUpgradeService,
     IQuestionnaireService questionnaireService
     )
 {
     _limitsService        = limitsService;
     _settingsService      = settingsService;
     _tierUpgradeService   = tierUpgradeService;
     _questionnaireService = questionnaireService;
 }
コード例 #10
0
        public QuestionnaireTests()
        {
            // Setup database mocks
            _dbMock = new Mock <FestispecContext>();

            _dbMock.Setup(x => x.Questionnaires)
            .Returns(MockHelpers.CreateDbSetMock(new ModelMocks().Questionnaires).Object);
            _dbMock.Setup(x => x.Questions).Returns(MockHelpers.CreateDbSetMock(new ModelMocks().Questions).Object);
            _dbMock.Setup(x => x.Answers).Returns(MockHelpers.CreateDbSetMock(new ModelMocks().Answers).Object);
            _dbMock.Setup(x => x.PlannedInspections)
            .Returns(MockHelpers.CreateDbSetMock(new ModelMocks().PlannedInspections).Object);
            _dbMock.Setup(x => x.Festivals).Returns(MockHelpers.CreateDbSetMock(new ModelMocks().Festivals).Object);
            _dbMock.Setup(x => x.Employees).Returns(MockHelpers.CreateDbSetMock(new ModelMocks().Employees).Object);
            _dbMock.Setup(m => m.SaveChangesAsync()).ReturnsAsync(1);

            _questionnaireService =
                new QuestionnaireService(_dbMock.Object, new JsonSyncService <Questionnaire>(_dbMock.Object));
        }
コード例 #11
0
        public RapportPreviewViewModel(
            IFrameNavigationService navigationService,
            IQuestionnaireService questionnaireService,
            IFestivalService festivalService,
            IConfiguration config,
            GraphSelectorFactory graphSelector,
            IEmployeeService employeeService
            )
        {
            _questionnaireService = questionnaireService;
            _navigationService    = navigationService;
            _graphFactory         = graphSelector;
            _config          = config;
            _employeeService = employeeService;
            SelectedFestival = festivalService.GetFestival((int)navigationService.Parameter);

            GeneratePdfCommand = new RelayCommand(SavePdf);
            BackCommand        = new RelayCommand(Back);

            GenerateReport();
        }
コード例 #12
0
        public FestivalViewModel(IFrameNavigationService navigationService, IFestivalService festivalService,
                                 IQuestionnaireService questionnaireService, IInspectionService inspectionService,
                                 IOfflineService offlineService)
        {
            _festivalService      = festivalService;
            _navigationService    = navigationService;
            _questionnaireService = questionnaireService;
            _inspectionService    = inspectionService;

            RemoveFestivalCommand = new RelayCommand(OpenDeletePopup, () => offlineService.IsOnline, true);
            DeleteCommand         = new RelayCommand(RemoveFestival, () => offlineService.IsOnline, true);
            EditFestivalCommand   = new RelayCommand(() => _navigationService.NavigateTo("UpdateFestival", Festival.Id),
                                                     () => offlineService.IsOnline, true);
            OpenQuestionnaireCommand          = new RelayCommand <int>(OpenQuestionnaire);
            CreateQuestionnaireCommand        = new RelayCommand(CreateQuestionnaire, () => offlineService.IsOnline, true);
            ConfirmDeleteQuestionnaireCommand =
                new RelayCommand(DeleteQuestionnaire, () => offlineService.IsOnline, true);
            DeleteQuestionnaireCommand =
                new RelayCommand <int>(id => _deletetingQuestionnareId = id, _ => offlineService.IsOnline, true);
            NewQuestionnaireCommand       = new RelayCommand(NewQuestionnaire);
            OpenCopyQuestionnaireCommand  = new RelayCommand <int>(OpenCopyQuestionnaire);
            CloseCopyQuestionnaireCommand = new RelayCommand(CloseCopyQuestionnaire);
            CopyQuestionnaireCommand      = new RelayCommand(CopyQuestionnaire);
            GenerateReportCommand         = new RelayCommand(GenerateReport);
            EditPlannedInspectionCommand  = new RelayCommand <List <PlannedInspection> >(plannedInspections =>
                                                                                         _navigationService.NavigateTo("Inspection",
                                                                                                                       new { PlannedInspectionId = plannedInspections[0].Id, FestivalId = -1 }),
                                                                                         _ => offlineService.IsOnline, true);
            CreatePlannedInspectionCommand =
                new RelayCommand(
                    () => _navigationService.NavigateTo("Inspection",
                                                        new { PlannedInspectionId = -1, FestivalId = Festival.Id }), () => offlineService.IsOnline,
                    true);

            CanEdit = offlineService.IsOnline;

            Initialize((int)_navigationService.Parameter);
        }
コード例 #13
0
 public QuestionnaireController(IQuestionnaireService myService)
 {
     _myService = myService;
 }
コード例 #14
0
 public QuestionnaireProblemController(IQuestionnaireProblemService newsService, IQuestionnaireService QuestionnaireService, IQuestionnaireAnswerService AnswerService)
 {
     this.service = newsService;
     this.QuestionnaireService = QuestionnaireService;
     this.AnswerService        = AnswerService;
 }
コード例 #15
0
 public QuestionnaireController(IQuestionnaireService questionnaireService)
 {
     _questionnaireService = questionnaireService;
 }
コード例 #16
0
 public QuestionnaireRepository(IQuestionnaireService service)
 {
     this.service = service;
 }
コード例 #17
0
 public QuestionnaireRepository(IQuestionnaireService service)
 {
     this.service = service;
 }
コード例 #18
0
 public QuestionnaireController(IQuestionnaireService newsService, IQuestionStatisticService Statisticservice)
 {
     this.service          = newsService;
     this.Statisticservice = Statisticservice;
 }
コード例 #19
0
 public CompleteQuestionnaire(IQuestionnaireService questionnaireService, IPredictionService predictionService)
 {
     _questionnaireService = questionnaireService;
     _predictionService    = predictionService;
 }
コード例 #20
0
 public QuestionsController(IEvidenceService evidenceService, IQuestionnaireService questionnaireService)
 {
     _evidenceService      = evidenceService;
     _questionnaireService = questionnaireService;
 }
コード例 #21
0
 public QuestionnaireController(IQuestionnaireService _questionnaireService)
 {
     questionnaireService = _questionnaireService;
 }
コード例 #22
0
 public QuestionnaireController(IQuestionnaireService questionnaireService, ITypeMapper typeMapper)
 {
     _questionnaireService = questionnaireService;
     _typeMapper           = typeMapper;
 }
コード例 #23
0
 public QuestionnaireController(IQuestionnaireService questionnaireService, IMarkingService markingService)
 {
     _questionnaireService = questionnaireService;
     _markingService       = markingService;
 }
コード例 #24
0
 public QuestionnaireController()
 {
     questionnaireService = new QuestionnaireServer();
 }
コード例 #25
0
 public InspectionController(IQuestionnaireService questionnaireService, AnswerFactory answerFactory)
 {
     _questionnaireService = questionnaireService;
     _answerFactory        = answerFactory;
 }
コード例 #26
0
 public QuestionnaireController(IQuestionnaireService questionnaireService,
                                IQuestionnaireInteractionService questionnaireInteractionService)
 {
     _qService            = questionnaireService;
     _qInteractionService = questionnaireInteractionService;
 }
コード例 #27
0
 public ListQuestionnaireController(IQuestionnaireService questionnaireService, IPdfService pdfService)
 {
     _questionnaireService = questionnaireService;
     _pdfService           = pdfService;
 }