Exemplo n.º 1
0
 public CakeScheduleService()
 {
     InitializeComponent();
     _mailService = new MailService(_departmentServices, _appConfigReader, DateTime.Now.Date);
     _cakeSheduleDao = new CakeScheduleDao(_appConfigReader.RepositoryPath);
     _departmentDao = new DepartmentDao(_appConfigReader.RepositoryPath);
     _scheduleWorker = new ScheduleWorker(_cakeScheduleServices, _departmentServices, _mailService,
                                          _cakeSheduleDao, _departmentDao, _appConfigReader);
     _serviceLogger = new ServiceLogger(_appConfigReader.LogPath);
     _scheduleWorker.CakeScheduleFinished += ScheduleFinished;
 }
Exemplo n.º 2
0
 public void SetUpScheduleWorker()
 {
     _scheduleWorker = new ScheduleWorker(_cakeScheduleServices, _departmentServices, _mailService,
                                          _cakeSheduleDao, _departmentDao, _appConfigReader);
     _scheduleWorker.CakeScheduleFinished += ScheduleFinished;
     _scheduleWorker.StartSchedule();
 }
Exemplo n.º 3
0
 public void SetUpScheduleWorker(int daysToAdd)
 {
     _mailServiceIsRun = false;
     _appConfigReader.SetTimerRunInterval(1);
     _appConfigReader.SetHourOfDayToRunService(DateTime.Now.Hour);
     _cakeSheduleDao.SetNextCakeDateMock(DateTime.Now.AddDays(daysToAdd));
     _scheduleWorker = new ScheduleWorker(_cakeScheduleServices, _departmentServices, _mailService,
                                          _cakeSheduleDao, _departmentDao, _appConfigReader);
     _scheduleWorker.CakeScheduleFinished += ScheduleFinished;
     _scheduleWorker.StartSchedule();
 }