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; }
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()); }
public CampaignInboxingStatistics(Campaign campaign) { Campaign = campaign; BatchStatistics = new List<HeatInboxingStatistics>(); DeliveryGroups = new List<DeliveryGroup>(); }