public Newsletter CreateNewsletter(NewsletterType type, string subject, string body) { NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath); Newsletter n = new Newsletter(); n.Body = body; n.Subject = subject; n.NewsletterType = type; nd.Save(n); return(n); }
public Newsletter UpdateNewsletter(int newsletterId, NewsletterType type, string subject, string body) { NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath); Newsletter n = nd.GetById(newsletterId); if (n != null) { n.Body = body; n.Subject = subject; n.NewsletterType = type; nd.Save(n); } return(n); }
public Newsletter GetNewsletter(int newsletterId) { NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath); return(nd.GetById(newsletterId)); }
public IList <Newsletter> GetNewsleters() { NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath); return(nd.GetAll()); }