Ejemplo n.º 1
0
 public QuestionController()
 {
     _questionRepo = ObjectFactory.GetInstance<IQuestionRepository>();
     _categoryRepo = ObjectFactory.GetInstance<ICategoryRepository>();
     _checklistRepository = ObjectFactory.GetInstance<ICheckListRepository>();
     _userForAuditingRepository = ObjectFactory.GetInstance<BusinessSafe.Domain.RepositoryContracts.IUserForAuditingRepository>();
 }      
Ejemplo n.º 2
0
 public CheckListController(ICheckListRepository checkListRepository,
                            IStatusRepository statusRepository,
                            ITaskCheckListRepository taskCheckListRepository,
                            ITaskRepository taskRepository)
 {
     _checkListRepository = checkListRepository;
     _sr  = statusRepository;
     _tsr = taskCheckListRepository;
     _tr  = taskRepository;
 }
Ejemplo n.º 3
0
		public ChecklistController(IDependencyFactory dependencyFactory)
		{
			_checklistRepository = dependencyFactory.GetInstance<ICheckListRepository>();
			_questionRepository = dependencyFactory.GetInstance<IQuestionRepository>();
			_questionResponseRepository = dependencyFactory.GetInstance<IQuestionResponseRepository>();
			_clientDetailsService = dependencyFactory.GetInstance<IClientDetailsService>();
			_getChecklistsQuery = dependencyFactory.GetInstance<IGetChecklistsQuery>();
			_checklistQuestionRepository = dependencyFactory.GetInstance<IChecklistQuestionRepository>();
			_employeeRespository = dependencyFactory.GetInstance<IEmployeeRepository>();
			_impressionRespository = dependencyFactory.GetInstance<IImpressionTypeRepository>();
			_categoryRepository = dependencyFactory.GetInstance<ICategoryRepository>();
			_timescaleRepository = dependencyFactory.GetInstance<ITimescaleRepository>();
			_userForAuditingRepository = dependencyFactory.GetInstance<IUserForAuditingRepository>();
			_siteRepository = dependencyFactory.GetInstance<ISiteRepository>();
			_checklistPdfCreator = dependencyFactory.GetInstance<IChecklistPdfCreator>();
			_clientDocumentationChecklistPdfWriter =
				dependencyFactory.GetInstance<IClientDocumentationChecklistPdfWriter>();
			_log = dependencyFactory.GetInstance<IPeninsulaLog>();
			_qaAdvisorRepository = dependencyFactory.GetInstance<IQaAdvisorRepository>();
            _industryRepository = dependencyFactory.GetInstance<IIndustryRepository>();
		    _bus = dependencyFactory.GetInstance<IBus>();
		}
Ejemplo n.º 4
0
        public void Setup()
        {
            ResourceUrl = string.Format("{0}{1}/", ApiBaseUrl, "Checklists");

            _checklistRepository = ObjectFactory.GetInstance<ICheckListRepository>();
            _questionRepository = ObjectFactory.GetInstance<IQuestionRepository>();
            _questionResponseRepository = ObjectFactory.GetInstance<IQuestionResponseRepository>();
            _userForAuditingRepository = ObjectFactory.GetInstance<IUserForAuditingRepository>();

            //Creats a new checklist if does not exist.
            _checklist = _checklistRepository.GetById(ApiTestChecklistId);

            if (_checklist == null)
            {

                _checklist = new SC.Checklist()
                {
                    Id = ApiTestChecklistId,
                    ClientId = ApiTestClientId,
                    SiteId = APiTestSiteId,
                    CoveringLetterContent = ApiTestCoveringLetterContents,
                    CreatedBy = _userForAuditingRepository.GetSystemUser(),
                   CreatedOn = DateTime.Now,
                    LastModifiedBy = _userForAuditingRepository.GetSystemUser(),
                    LastModifiedOn = DateTime.Now
                };

                var questions = _questionRepository.GetAll().Take(1).ToList();

                //_checklist.UpdateQuestions(questions, new UserForAuditing());
                foreach (var question in questions)
                {
                    _checklist.Questions.Add(new ChecklistQuestion
                    {
                        Checklist = _checklist,
                        Question = question,
                        CreatedBy = _userForAuditingRepository.GetSystemUser(),
                        CreatedOn = DateTime.Now,
                        LastModifiedBy = _userForAuditingRepository.GetSystemUser(),
                        LastModifiedOn = DateTime.Now
                    });
                }

                var response = questions.First().PossibleResponses
                    .Where(r => r.ResponseType.Equals("Positive"))
                    .Select(
                        r => new SC.ChecklistAnswer()
                        {
                            SupportingEvidence = r.SupportingEvidence,
                            ActionRequired = r.ActionRequired,
                            Question = questions.First(),
                            Response = r,
                            CreatedBy = _userForAuditingRepository.GetSystemUser(),
                            CreatedOn = DateTime.Now,
                            LastModifiedBy = _userForAuditingRepository.GetSystemUser(),
                            LastModifiedOn = DateTime.Now
                        })
                    .ToList();

                _checklist.UpdateAnswers(response, _userForAuditingRepository.GetSystemUser());

                _checklistRepository.SaveOrUpdate(_checklist);
            }

            _totalNumberOfChecklistQuestions = _checklist.Questions.Count();
            _totalNumberOfChecklistAnswers = _checklist.Answers.Count();

            ObjectFactory.Container.GetInstance<IBusinessSafeSessionManager>().CloseSession();
        }
Ejemplo n.º 5
0
 public CheckListBusiness(ICheckListRepository checkListRepository, ILogger logger)
 {
     _checkListRepository = checkListRepository;
     _logger = logger;
 }
Ejemplo n.º 6
0
 private void btnLoadLists_Click(object sender, EventArgs args)
 {
     this.Repository = new CheckListRepository(this.Service);
     LoadCheckLists();
 }
 public ChecklistService(ICheckListRepository con, ITaskServices taskservice)
 {
     _context     = con;
     _taskservice = taskservice;
 }
 public MySendSafeCheckChecklistCompletedEmailHandler(IEmailSender emailSender, ISafeCheckEmailLinkBaseUrlConfiguration urlConfiguration, ICheckListRepository checklistRepository,
     IQaAdvisorRepository qaRepository)
     : base(emailSender, urlConfiguration, checklistRepository, qaRepository)
 {
 }
 public CheckListsApiController(ICheckListRepository checkListRepository,
                                ICheckListItemRepository checkListItemRepository)
 {
     this.checkListRepository     = checkListRepository;
     this.checkListItemRepository = checkListItemRepository;
 }
Ejemplo n.º 10
0
 public CheckListsController(ICheckListRepository repository,
                             ICheckListItemRepository itemRepository)
 {
     this.repository     = repository;
     this.itemRepository = itemRepository;
 }
Ejemplo n.º 11
0
 public CheckListsController(ICheckListRepository repository)
 {
     this.repository = repository;
 }
Ejemplo n.º 12
0
 public ChecklistService(IDependencyFactory dependencyFactory)
 {
     _checklistRepository = dependencyFactory.GetInstance<ICheckListRepository>();
     _userForAuditingRepository = dependencyFactory.GetInstance<IUserForAuditingRepository>();
     _clientDocumentationChecklistPdfWriter = dependencyFactory.GetInstance<IClientDocumentationChecklistPdfWriter>();
 }
 public FakeSendChecklistSubmitEmailHandler(
     IEmailSender emailSender, ICheckListRepository checklistRepository,
     IBusinessSafeEmailLinkBaseUrlConfiguration businessSafeEmailLinkBaseUrlConfiguration, IDocumentLibraryService docLibraryService
     , IClientDocumentService clientDocumentService, IClientService clientService)
     : base(emailSender, checklistRepository, businessSafeEmailLinkBaseUrlConfiguration, docLibraryService, clientDocumentService, clientService)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Inject CheckList repository
 /// </summary>
 /// <returns></returns>
 public CheckListService(ICheckListRepository checkListRepository)
 {
     _checkListRepository = checkListRepository ?? throw new ArgumentNullException($"{nameof(checkListRepository)}");
 }