Example #1
0
 public CancelOnBulking(
     ILog logger,
     IMtaAgent mtaAgent,
     EmailNotification notificationEmails,
     IUnitOfWork unitOfWork,
     IEventRepository eventRepository,
     IJobRepository jobRepository
     )
 {
     _logger = logger;
     _unitOfWork = unitOfWork;
     _mtaAgent = mtaAgent;
     _eventRepository = eventRepository;
     _jobRepository = jobRepository;
     _emailNotification = notificationEmails;
 }
Example #2
0
 public Four21(
     ILog logger,
     IMtaAgent mtaAgent,
     EmailNotification emailNotification,
     Func<IUnitOfWork> unitOfWorkFactory,
     Func<IUnitOfWork, IEventRepository> eventRepoFactory,
     Func<IUnitOfWork, IPmtaRepository> pmtaRepoFactory,
     Func<IUnitOfWork, IDeliveryGroupRepository> deliveryGroupRepoFactory,
     Func<IUnitOfWork, IJobRepository> jobRepoFactory
     )
 {
     _mtaAgent = mtaAgent;
     _logger = logger;
     _emailNotification = emailNotification;
     _unitOfWorkFactory = unitOfWorkFactory;
     _eventRepoFactory = eventRepoFactory;
     _pmtaRepoFactory = pmtaRepoFactory;
     _deliveryGroupRepoFactory = deliveryGroupRepoFactory;
     _jobRepoFactory = jobRepoFactory;
 }
Example #3
0
        static void F21Reset()
        {
            Database.SetInitializer<OenContext>(null);
            var oenContext = new OenContext();
            var logger = new Logger();
            var jobRepository = new JobRepository(oenContext, logger, true);
            var settings = new Four21Settings(oenContext);
#if DEBUG
            var emailNotify = new EmailNotification(logger, jobRepository, new string[] { "*****@*****.**" }, settings.SmtpServer);
#else
            var emailNotify = new EmailNotification(logger, jobRepository, settings.NotifyEmails, settings.SmtpServer);
#endif
            var f21 = new Four21(logger,
                                 new MtaAgentMock(0, logger),
                                 emailNotify,
                                 () => new OenContext(),
                                 u => new EventRepository((OenContext) u),
                                 u => new PmtaRepository((OenContext) u),
                                 u => new DeliveryGroupRepository((OenContext) u),
                                 u => new JobRepository((OenContext) u, logger, true)
                                 );

            try
            {
                f21.ResumeQueues(DateTime.Now);
            }
            catch (Exception ex)
            {
                logger.Error(ex.UnwrapForLog(true));
            }
        }