public ActionResult EventSelection(Guid itemId, int? eventId, int? eventDateId, int? eventWaveId, bool? returnToRegDetails, bool? redemption)
        {
            int eId = (eventId.HasValue)? eventId.Value : 0;

            var vm = new vmRegistration_EventSelection
            {
                ItemId = itemId,
                CartFocus = SessionManager.CurrentCart.CheckOutFocus,
                EventOverview = (eventId.HasValue && eventId > 0 ? _service.GetEventOverviewById(eId) : new EventOverview()),
                EventDateCount = (eventId.HasValue && eventId > 0 ? GetEventDateCount(eId) : 0),
                LockEvent = true,
                ReturnToRegistrationDetails = false
            };

            if (eventWaveId.HasValue)
            {
                EventWave selectedWave = _service.GetEventWaveById(eventWaveId.Value);
                vm.EventId = selectedWave.EventDate.EventId;
                vm.EventDateId = selectedWave.EventDateId;
                vm.EventWaveId = selectedWave.EventWaveId;
            }
            else if(eventDateId.HasValue)
            {
                EventDate selectedDate = _service.GetEventDateById(eventDateId.Value);
                vm.EventId = selectedDate.EventId;
                vm.EventDateId = selectedDate.EventDateId;
            }
            else if (eventId.HasValue)
            {
                Event selectedEvent = _service.GetEventById(eventId.Value);
                vm.EventId = eventId.Value;
                vm.EventDateId = selectedEvent.EventDates.First().EventDateId;
                vm.EventName = selectedEvent.GeneralLocality;
            }

            // did the cart timeout?
            if (!SessionManager.CurrentCart.ActionItems.ContainsKey(itemId))
            {
                return RedirectToAction("Index", "home");
            }
            if (SessionManager.CurrentCart.ActionItems[itemId].ActionType == CartActionType.EventChange ||
                SessionManager.CurrentCart.CheckOutFocus == CartFocusType.Redemption)
                vm.LockEvent = false;

            if (returnToRegDetails.HasValue && returnToRegDetails.Value == true)
                vm.ReturnToRegistrationDetails = true;

            return View(vm);
        }
        public ActionResult EventSelection(int registrationId = 0)
        {
            var vm = new vmRegistration_EventSelection();
            var currentRegistration = _registrationService.GetRegistrationById(registrationId);

            vm.EventId = currentRegistration.EventWave.EventDate.EventId;
            vm.EventDateId = currentRegistration.EventWave.EventDateId;
            vm.EventWaveId = currentRegistration.EventWaveId;

            vm.LockEvent = false;
            HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
            HttpContext.Response.Cache.SetValidUntilExpires(false);
            HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
            HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Response.Cache.SetNoStore();
            return View(vm);
        }