Exemple #1
0
        public async Task processSignUpToCourse(ISignUpToCourseService _service)
        {
            var courses = simulateReadRequestFromFile();
            var emails  = new List <Email>();

            foreach (var course in courses)
            {
                try
                {
                    var result = await _service.Post(course);

                    if (result != null)
                    {
                        emails.Add(new Email()
                        {
                            email   = result.StudentEmail,
                            content = "Sua inscricao foi realizado com sucesso"
                        });
                    }
                }
                catch (ArgumentException)
                {
                }
                sendEmail(emails);
            }
        }
Exemple #2
0
 public SignUpToCoursesController(ISignUpToCourseService service)
 {
     _service = service;
     JobManager.Initialize();
     JobManager.AddJob(
         async() => await new RegistroTarefasAgendadas().processSignUpToCourse(_service),
         s => s.ToRunEvery(15).Seconds()
         );
 }
Exemple #3
0
 public CourseStatisticsService(ICourseStatisticsRepository repository, IMapper mapper, ISignUpToCourseService signUpToCourseService)
 {
     _repository            = repository;
     _mapper                = mapper;
     _signUpToCourseService = signUpToCourseService;
 }