Exemple #1
0
        public ActionResult InsertNewsLetter(string email)
        {
            NewsLetter newsLetter = new NewsLetter();

            newsLetter.Email       = email;
            newsLetter.CreatedDate = DateTime.Now;
            NewsLetterManager.InsertNewsLetter(newsLetter);
            return(RedirectToAction("Index"));
        }
        public ActionResult InsertNewsLetter(NewsLetter newsletter)
        {
            NewsLetterManager manager = new NewsLetterManager();

            if (newsletter != null && newsletter.NewsLetterId > 0)
            {
                NewsLetterManager.UpdateNewsLetter(newsletter);
            }
            else
            {
                NewsLetterManager.InsertNewsLetter(newsletter);
            }


            return(RedirectToAction("AdminNewsLetters"));
        }
 public ActionResult DeleteNewsLetter(long newsletterId)
 {
     NewsLetterManager.DeleteNewsLetter(newsletterId);
     return(RedirectToAction("AdminNewsLetters"));
 }
        public ActionResult UpdateNewsLetter(int newsletterId)
        {
            NewsLetter newsletter = NewsLetterManager.GetNewsLetterById(newsletterId);

            return(View("~/Views/NewsLetter/InsertNewsLetter.cshtml", newsletter));
        }
        public ActionResult AdminNewsLetters()
        {
            List <NewsLetter> allNewsLetters = NewsLetterManager.GetAllNewsLetters();

            return(View("~/Views/NewsLetter/AdminNewsLetters.cshtml", allNewsLetters));
        }