public ServiceDetailBusiness(MardisContext mardisContext) : base(mardisContext)
 {
     _serviceDetailDao  = new ServiceDetailDao(mardisContext);
     _questionDao       = new QuestionDao(mardisContext);
     _questionDetailDao = new QuestionDetailDao(mardisContext);
     _answerDao         = new AnswerDao(mardisContext);
     _answerDetailDao   = new AnswerDetailDao(mardisContext);
 }
Exemplo n.º 2
0
 public ServiceBusiness(MardisContext mardisContext) : base(mardisContext)
 {
     _serviceDao        = new ServiceDao(mardisContext);
     _serviceDetailDao  = new ServiceDetailDao(mardisContext);
     _questionDao       = new QuestionDao(mardisContext);
     _questionDetailDao = new QuestionDetailDao(mardisContext);
     _typePollDao       = new TypePollDao(mardisContext);
     _sequenceBusiness  = new SequenceBusiness(mardisContext);
     _typeServiceDao    = new TypeServiceDao(mardisContext);
     _customerDao       = new CustomerDao(mardisContext);
 }
Exemplo n.º 3
0
 public ServiceBusiness(MardisContext mardisContext, RedisCache distributedCache) : base(mardisContext)
 {
     _serviceDao        = new ServiceDao(mardisContext);
     _serviceDetailDao  = new ServiceDetailDao(mardisContext);
     _questionDao       = new QuestionDao(mardisContext);
     _questionDetailDao = new QuestionDetailDao(mardisContext);
     _typePollDao       = new TypePollDao(mardisContext);
     _sequenceBusiness  = new SequenceBusiness(mardisContext);
     _typeServiceDao    = new TypeServiceDao(mardisContext);
     _customerDao       = new CustomerDao(mardisContext);
     _redisCache        = distributedCache;
 }
        public TaskCampaignBusiness(MardisContext mardisContext, RedisCache distributedCache)
            : base(mardisContext)
        {
            _taskCampaignDao           = new TaskCampaignDao(mardisContext);
            _questionDetailDao         = new QuestionDetailDao(mardisContext);
            _statusTaskBusiness        = new StatusTaskBusiness(mardisContext, distributedCache);
            _sequenceBusiness          = new SequenceBusiness(mardisContext);
            _campaignServicesDao       = new CampaignServicesDao(mardisContext);
            _branchDao                 = new BranchDao(mardisContext);
            _answerDao                 = new AnswerDao(mardisContext);
            _answerDetailDao           = new AnswerDetailDao(mardisContext);
            _branchImageBusiness       = new BranchImageBusiness(mardisContext);
            _userDao                   = new UserDao(mardisContext);
            _campaignDao               = new CampaignDao(mardisContext);
            _serviceDetailTaskBusiness = new ServiceDetailTaskBusiness(mardisContext);
            _personDao                 = new PersonDao(mardisContext);
            _profileDao                = new ProfileDao(mardisContext);
            _typeUserBusiness          = new TypeUserBusiness(mardisContext, distributedCache);
            _serviceDetailDao          = new ServiceDetailDao(mardisContext);
            _questionDao               = new QuestionDao(mardisContext);
            _redisCache                = distributedCache;
            _serviceDetailBusiness     = new ServiceDetailBusiness(mardisContext);

            Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <Service, MyTaskServicesViewModel>()
                .ForMember(dest => dest.ServiceDetailCollection, opt => opt.MapFrom(src => src.ServiceDetails.OrderBy(sd => sd.Order)));
                cfg.CreateMap <ServiceDetail, MyTaskServicesDetailViewModel>()
                .ForMember(dest => dest.QuestionCollection, opt => opt.MapFrom(src => src.Questions.OrderBy(q => q.Order)))
                .ForMember(dest => dest.Sections, opt => opt.MapFrom(src => src.Sections.OrderBy(s => s.Order)));
                cfg.CreateMap <Question, MyTaskQuestionsViewModel>()
                .ForMember(dest => dest.HasPhoto, opt => opt.MapFrom(src => src.HasPhoto.IndexOf("S", StringComparison.Ordinal) >= 0))
                .ForMember(dest => dest.QuestionDetailCollection, opt => opt.MapFrom(src => src.QuestionDetails.OrderBy(qd => qd.Order)))
                .ForMember(dest => dest.CodeTypePoll, opt => opt.MapFrom(src => src.TypePoll.Code));
                cfg.CreateMap <QuestionDetail, MyTaskQuestionDetailsViewModel>();
            });
        }