示例#1
0
        public ActionResult CreateEvent(DateTime date, int maxPeople)
        {
            var   db = new HockeySignupsDb(Properties.Settings.Default.ConStr);
            Event e  = new Event {
                Date = date, MaxPeople = maxPeople
            };

            db.AddEvent(e);
            TempData["Message"] = "Event Successfully created, Id: " + e.Id;
            return(RedirectToAction("Index", "Hockey"));
        }
示例#2
0
        public ActionResult CreateEvent(Event e)
        {
            HockeySignupsDb db = new HockeySignupsDb(_connectionString);

            db.AddEvent(e);
            #region TempData
            TempData["Message"] = "Event Successfully created, Id: " + e.Id;
            #endregion
            IEnumerable <NotificationSignup> signups = db.GetNotificationSignups();
            foreach (NotificationSignup signup in signups)
            {
                //send email using signup.Email
            }
            return(RedirectToAction("Index", "Hockey"));
        }
示例#3
0
        public ActionResult CreateEvent(DateTime date, int maxPeople)
        {
            var   db = new HockeySignupsDb(_connectionString);
            Event e  = new Event {
                Date = date, MaxPeople = maxPeople
            };

            db.AddEvent(e);
            TempData["Message"] = "Event Successfully created, Id: " + e.Id;
            IEnumerable <NotificationSignup> signups = db.GetNotificationSignups();

            foreach (NotificationSignup signup in signups)
            {
                //send email using signup.Email
            }
            return(RedirectToAction("Index", "Hockey"));
        }
示例#4
0
        public ActionResult CreateEvent(DateTime date, int maxPeople)
        {
            var   db = new HockeySignupsDb(Properties.Settings.Default.ConStr);
            Event e  = new Event {
                Date = date, MaxPeople = maxPeople
            };

            db.AddEvent(e);

            TempData["Message"] = "Event Successfully created, Id: " + e.Id;
            IEnumerable <NotificationSignup> signups = db.GetNotificationSignups();

            foreach (NotificationSignup signup in signups)
            {
                SendNotificationEmail(signup);
            }
            return(RedirectToAction("Index", "Hockey"));
        }