コード例 #1
0
ファイル: Job.cs プロジェクト: 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;
        }
コード例 #2
0
ファイル: Job.cs プロジェクト: 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());
        }
コード例 #3
0
 public CampaignInboxingStatistics(Campaign campaign)
 {
     Campaign = campaign;
     BatchStatistics = new List<HeatInboxingStatistics>();
     DeliveryGroups = new List<DeliveryGroup>();
 }