Esempio n. 1
0
        public void  CreateNewsletter(string name, string html)
        {
            IEnumerable <Subscription> subscriptions = SubscriptionRepository.Get(s => s.IsConfirmed == true, null, null);
            Newsletter newsletter = new Newsletter();

            newsletter.Name        = name;
            newsletter.DateCreated = DateTime.UtcNow;
            newsletter.Html        = html;
            newsletter.InProcess   = false;
            foreach (Subscription s in subscriptions)
            {
                NewsletterTask newslettertask = new NewsletterTask();
                newslettertask.SetNewsletter(newsletter);
                newslettertask.SetSubscription(s);
                newsletter.AddNewsletterTask(newslettertask);
            }
            NewsletterRepository.Insert(newsletter);
            NewsletterRepository.UnitOfWork.Commit();
        }
Esempio n. 2
0
 /// <summary>
 /// Update NewsletterTask from context
 /// </summary>
 /// <param name="task"></param>
 public void UpdateNewsletterTask(NewsletterTask task)
 {
     currentunitofwork.SetModified <NewsletterTask>(task);
 }
Esempio n. 3
0
 /// <summary>
 /// Delete NewsletterTask from context
 /// </summary>
 /// <param name="task"></param>
 public void DeleteNewsletterTask(NewsletterTask task)
 {
     currentunitofwork.Set <NewsletterTask>().Remove(task);
 }
Esempio n. 4
0
 public void UpdateNewsletterTask(NewsletterTask task)
 {
     NewsletterRepository.UpdateNewsletterTask(task);
     NewsletterRepository.UnitOfWork.Commit();
 }