protected override void OnPreRender(EventArgs e) { if (this.NewsletterId > 0) { Newsletter nl = WAFContext.Session.GetContent<Newsletter>(this.NewsletterId); AqlQuery q = WAFContext.Session.CreateQuery(); AqlAliasNewsletterDelivery aliasDelivery = new AqlAliasNewsletterDelivery(); AqlAliasNewsletter aliasNewsletter = new AqlAliasNewsletter(); AqlAliasRelNewsletterDelivery relNewsletterDeliveries = new AqlAliasRelNewsletterDelivery(aliasNewsletter, aliasDelivery); q.From(relNewsletterDeliveries); q.Select(aliasDelivery.NodeId); //0 q.Select(aliasDelivery.Subject); //1 q.Select(aliasDelivery.DeliveryEndedDate); //2 q.Select(aliasDelivery.NumberOfRecipients); //3 q.Select(aliasDelivery.ContentClassId); //4 q.Select(aliasDelivery.NumberSent); //5 q.Where(aliasNewsletter.NodeId == this.NewsletterId); q.Where(aliasDelivery.Status == "SENDING"); q.OrderBy(aliasDelivery.DeliveryStartDate, true); contentListDeliveries.Query = q; contentListDeliveries.DataBind(); // contentListDeliveries.Query = nl.Deliveries.Query<NewsletterDelivery>().Where(AqlNewsletterDelivery.Status == "SENDING").OrderBy(AqlNewsletterDelivery.CreateDate, true).GetAqlQuery(); //contentListDeliveries.DataBind(); } base.OnPreRender(e); }
public void UpdateDeliveryList() { if (this.NewsletterId > 0) { if (WAFContext.Session.ContentExists(this.NewsletterId)) { AqlQuery q = WAFContext.Session.CreateQuery(); AqlAliasNewsletterDelivery aliasDelivery = new AqlAliasNewsletterDelivery(); AqlAliasNewsletter aliasNewsletter = new AqlAliasNewsletter(); AqlAliasRelNewsletterDelivery relNewsletterDeliveries = new AqlAliasRelNewsletterDelivery(aliasNewsletter, aliasDelivery); q.From(relNewsletterDeliveries); q.Select(aliasDelivery); //0 q.Select(aliasDelivery.Subject); //1 q.Select(aliasDelivery.DeliveryEndedDate); //2 q.Select(aliasDelivery.NumberSent); //3 q.Select(aliasDelivery.ContentClassId); //4 q.Select(aliasDelivery.NumberOfUnsubscribes); //5 q.Select(aliasDelivery.LastClickDate); //6 q.Select(aliasDelivery.LastReadDate); //7 q.Select(aliasDelivery.Clicks); //8 q.Select(aliasDelivery.NodeId); //9 q.Where(aliasNewsletter.NodeId == this.NewsletterId); q.Where(aliasDelivery.Status == "SENT"); q.OrderBy(aliasDelivery.DeliveryEndedDate, true); contentListDeliveries.Query = q; contentListDeliveries.DataBind(); if (contentListDeliveries.GetSelectedCount() == 0) { if (this.DeliveryId > 0) { contentListDeliveries.SetSelected(this.DeliveryId); } } } } }
protected override void OnPreRender(EventArgs e) { if (this.NewsletterId > 0) { AqlQuery q = WAFContext.Session.CreateQuery(); AqlAliasNewsletterDelivery aliasDelivery = new AqlAliasNewsletterDelivery(); AqlAliasNewsletter aliasNewsletter = new AqlAliasNewsletter(); AqlAliasRelNewsletterDelivery relNewsletterDeliveries = new AqlAliasRelNewsletterDelivery(aliasNewsletter, aliasDelivery); q.From(relNewsletterDeliveries); q.Select(aliasDelivery); q.Select(aliasDelivery.NodeId); q.Select(aliasDelivery.Subject); q.Select(aliasDelivery.ChangeDate); q.Select(aliasDelivery.CreateDate); q.Select(aliasDelivery.ContentClassId); q.Where(aliasNewsletter.NodeId == this.NewsletterId); q.Where(aliasDelivery.Status == "DRAFT"); q.OrderBy(aliasDelivery.CreateDate, true); //Newsletter nl = WAFContext.Session.GetContent<Newsletter>(this.NewsletterId); //contentListDeliveries.Query = nl.Deliveries.Query<NewsletterDelivery>().Where(AqlNewsletterDelivery.Status == "DRAFT").OrderBy(AqlNewsletterDelivery.CreateDate, true).GetAqlQuery(); contentListDeliveries.Query = q; contentListDeliveries.DataBind(); } base.OnPreRender(e); }