コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public Newsletter GetNewsletter(int newsletterId)
        {
            NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath);

            return(nd.GetById(newsletterId));
        }
コード例 #4
0
        public IList <Newsletter> GetNewsleters()
        {
            NewsletterDao nd = new NewsletterDao(sessionFactoryConfigPath);

            return(nd.GetAll());
        }