Exemplo n.º 1
0
Arquivo: Job.cs Projeto: c0d3m0nky/mty
        public static IQueryable<Job> GetHotmailRelatedJobsSent(IJobRepository jobRepository, Campaign campaign, DateTime cutOffTime)
        {
            var jobs = jobRepository.GetAll()
                          .Where(j => j.Template.creative_id == campaign.Template.creative_id
                                      && j.Template.fromName.Trim() == campaign.Template.fromName.Trim()
                                      && j.Template.emailSubject.Trim() == campaign.Template.emailSubject
                                      && j.deliverygroup_id.HasValue
                                      && j.DeliveryGroup.CancelOnBulkingEnabled
                                      && DeliveringJobStatusIds.Contains(j.jobstatus_id)
                                      && j.datelaunch < cutOffTime);

            return jobs;
        }
Exemplo n.º 2
0
Arquivo: Job.cs Projeto: c0d3m0nky/mty
        public static void CancelHotmailRelatedJobs(IJobRepository jobRepository, ILog logger, Campaign campaign, DateTime cutOffTime, Event dblogEvent)
        {
            var jobs = jobRepository.GetAll()
                          .Where(j => j.Template.creative_id == campaign.Template.creative_id
                                      && j.Template.fromName.Trim() == campaign.Template.fromName.Trim()
                                      && j.Template.emailSubject.Trim() == campaign.Template.emailSubject
                                      && !CancellationExcludedJobStatusIds.Contains(j.jobstatus_id)
                                      && j.deliverygroup_id.HasValue
                                      && j.DeliveryGroup.CancelOnBulkingEnabled
                                      && j.datelaunch < cutOffTime).ToArray();

            foreach (var j in jobs)
            {
                j.Cancel(jobRepository,dblogEvent);
                logger.TraceFormat("Cancelled Job {0} and its targets", j.job_id);
            }
            logger.InfoFormat("Cancelled {0} Jobs", jobs.Count());
        }
Exemplo n.º 3
0
 public CampaignInboxingStatistics(Campaign campaign)
 {
     Campaign = campaign;
     BatchStatistics = new List<HeatInboxingStatistics>();
     DeliveryGroups = new List<DeliveryGroup>();
 }