예제 #1
0
 public IList<EventDateDetails> GetSimpleDateDetailsByEvent(int eventId)
 {
     var eventService = new EventService(this._repository);
     return eventService.GetSimpleDateDetailsByEvent(eventId);
 }
예제 #2
0
 public IList<EventWaveDetails> GetWaveDetialsForEventDate(int eventDateId)
 {
     var eventService = new EventService(this._repository);
     return eventService.GetWaveDetailsForEventDate(eventDateId);
 }
예제 #3
0
 public EventFee GetShippingFeeForEvent(int eventId)
 {
     var eventService = new EventService(this._repository, false);
     return eventService.GetCurrentFeeForEvent(eventId, EventFeeType.Shipping);
 }
예제 #4
0
 public IList<EventBasics> GetSimpleActiveEventList()
 {
     IEventService eventService = new EventService(this._repository);
     return eventService.GetSimpleActiveEventList();
 }
예제 #5
0
 public EventOverview GetEventOverviewById(int eventId)
 {
     EventService eventService = new EventService(this._repository);
     return eventService.GetEventOverviewById(eventId);
 }
예제 #6
0
 public EventFee GetCurrentEventFeeForWave(int eventWaveId, EventFeeType feeType)
 {
     var eventService = new EventService(this._repository, false);
     return eventService.GetCurrentFeeForWave(eventWaveId, feeType);
 }
예제 #7
0
 public IList<EventDetails> GetActiveUpcomingEvents()
 {
     IEventService eventService = new EventService(this._repository);
     return eventService.GetAllUpcomingEventDetails();
 }
예제 #8
0
        private List<CartSummaryLineItem> GenerateLineItems(SessionCart currentCart)
        {
            List<CartSummaryLineItem> lineItems = new List<CartSummaryLineItem>();
            IRegistrationService regService = new RegistrationService(this._repository, false);

            foreach (var item in currentCart.ActionItems.Where(x => x.Value.ItemReadyForCheckout))
            {

                var lineItem = new CartSummaryLineItem();

                EventService evtService = new EventService(_repository, false);
                Registration reg;
                EventFee fee;
                Event evt;
                EventDate evtDate;
                EventWave evtWave;

                switch (item.Value.ActionType)
                {
                    case CartActionType.NewRegistration:

                        reg = (Registration)item.Value.ActionObject;
                        evtWave = evtService.GetEventWaveById(reg.EventWaveId);
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.Registration);

                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Registration,
                                        ProcessType.Individual,
                                        "Registration",
                                        string.Format("{0}, {1} : {2} {3}", evt.GeneralLocality, evt.Region.Code, evtDate.DateOfEvent.ToString("dddd  MMMM dd, yyyy"), evtWave.StartTime.ToString("h:mm tt")),
                                        fee.PurchaseItemId,
                                        reg.RegistrationType == RegistrationType.CancerRegistration ? 0 : fee.Cost,
                                        fee.Discountable,
                                        fee.Taxable,
                                        evt.StateTax,
                                        evt.LocalTax,
                                        true));

                        break;
                    case CartActionType.EventChange:

                        var changeAction = (ChangeEventAction)item.Value.ActionObject;
                        evtWave = evtService.GetEventWaveById(changeAction.UpdatedEventWaveId);
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.ChangeEvent);

                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Fee,
                                        ProcessType.General,
                                        "Event Change",
                                        string.Format("Changing your registration to {0}, {1} : {2} {3}", evt.GeneralLocality, evt.Region.Code, evtDate.DateOfEvent.ToString("dddd  MMMM dd, yyyy"), evtWave.StartTime.ToString("h:mm tt")),
                                        fee.PurchaseItemId,
                                        fee.Cost,
                                        false,
                                        false,
                                        null,
                                        null,
                                        true));

                        var originalCost = regService.GetRegistrationPathValue(changeAction.RegistrationId);
                        var regFee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.Registration);

                        if (regFee.Cost > originalCost)
                        {
                            var additionalcost = regFee.Cost - originalCost;

                            lineItems.Add(GenerateLineItem(evt.EventId,
                                            null,
                                            PurchaseType.FeeDifference,
                                            ProcessType.Individual,
                                            "Difference Cost",
                                            string.Format("The event you have selected has a fee difference of {0}.", additionalcost.ToString("c")),
                                            1,
                                            additionalcost,
                                            true,
                                            true,
                                            evt.StateTax,
                                            evt.LocalTax,
                                            true));
                        }

                        break;
                    case CartActionType.TransferRregistration:
                        var transferAction = (TransferAction)item.Value.ActionObject;

                        evtWave = _repository.Registrations.Find(transferAction.RegistrationId).EventWave;
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.Transfer);

                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Fee,
                                        ProcessType.General,
                                        "Transfer to friend",
                                        string.Format("Transfering your registration for {0}, {1} : {2} {3} to {4} using {5}.", evt.GeneralLocality, evt.Region.Code, evtDate.DateOfEvent.ToString("dddd  MMMM dd, yyyy"), evtWave.StartTime.ToString("h:mm tt"), string.Format("{0} {1}", transferAction.FirstName, transferAction.LastName), transferAction.Email),
                                        fee.PurchaseItemId,
                                        fee.Cost,
                                        false,
                                        false,
                                        null,
                                        null,
                                        true));

                        break;
                    case CartActionType.CancelRegistration:
                        var cancelAction = (CancellationAction)item.Value.ActionObject;

                        evtWave = _repository.Registrations.Find(cancelAction.RegistrationId).EventWave;
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.Cancellation);

                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Fee,
                                        ProcessType.General,
                                        "Cancellation",
                                        string.Format("Cancelling your registration for {0}, {1} : {2} {3}.  You will be issued a cancellation code of the original value that can be used towards another event.", evt.GeneralLocality, evt.Region.Code, evtDate.DateOfEvent.ToString("dddd  MMMM dd, yyyy"), evtWave.StartTime.ToString("h:mm tt")),
                                        fee.PurchaseItemId,
                                        fee.Cost,
                                        false,
                                        false,
                                        null,
                                        null,
                                        true));

                        break;

                    case CartActionType.ShippingFee:

                        var shippingCost = (ShippingFeeAction)item.Value.ActionObject;
                        evtWave = evtService.GetEventWaveById(shippingCost.EventWaveId);
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.Shipping);
                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Fee,
                                        ProcessType.General,
                                        "Shipping Fee",
                                        "Shipping Fee for registration packet",
                                        fee.PurchaseItemId,
                                        fee.Cost,
                                        false,
                                        false,
                                        null,
                                        null,
                                        false));
                        break;

                    case CartActionType.ProcessingFee:

                        var processingCost = (ProcessingFeeAction)item.Value.ActionObject;
                        evtWave = evtService.GetEventWaveById(processingCost.EventWaveId);
                        evtDate = evtWave.EventDate;
                        evt = evtDate.Event;
                        fee = evtService.GetCurrentFeeForEvent(evt.EventId, EventFeeType.ProcessingFee);
                        lineItems.Add(GenerateLineItem(evt.EventId,
                                        item.Key,
                                        PurchaseType.Fee,
                                        ProcessType.General,
                                        PROCESSING_FEE,
                                        "",
                                        fee.PurchaseItemId,
                                        fee.Cost,
                                        false,
                                        false,
                                        null,
                                        null,
                                        false));
                        break;
                }

            }

            return lineItems;
        }
예제 #9
0
 public IList<EventOverview> GetUpcomingEvents()
 {
     IEventService _eventService = new EventService(this._repository, false);
     return _eventService.GetUpcomingEventOverviews();
 }