Example #1
0
        public ActionResult Add()
        {
            var user = _authenticatedUser.GetUserInfo();
            var addEvent = new AddEventView();

            ViewData["timezone"] = _timezoneHydration.GetAndSetSelectedTimezone(user.Timezone);
            return View(addEvent);
        }
Example #2
0
        public ActionResult Add(NewEventModel newEvent)
        {
            var addEvent = new AddEventView();

            var user = _authenticatedUser.GetUserInfo();
            var evt = MapCreateEventModel(newEvent);
            evt.UserId = user.Id;

            evt.NumberSid = _service.ProcureNumber(evt.Number);

            using (var tran = _session.BeginTransaction())
            {
                _session.Save(evt);
                tran.Commit();
            }

            ViewData["timezone"] = _timezoneHydration.GetAndSetSelectedTimezone();
            addEvent.Message = string.Format("New event created. Phone number: {0}", evt.FormattedNumber);

            return View(addEvent);
        }