private FeelSearchQueryResult AdvanceSearch(FeelSearchQuery query)
        {
            var siteEvents = _eventSiteIdMappingRepository
                             .GetBySiteId(query.SiteId)
                             .OrderBy(o => o.SortOrder).ToList();

            List <Contracts.DataModels.Event> searchEvents = new List <Contracts.DataModels.Event>();

            if (query.PlaceAltIds != null && query.PlaceAltIds.Count() > 0)
            {
                searchEvents = _eventRepository.GetEventsByAltIds(query.PlaceAltIds)
                               .ToList();
            }
            else
            {
                searchEvents = _eventRepository.GetFeelEventsBySearchString(query.Name, query.SiteId)
                               .ToList();
            }

            var eventMapping          = searchEvents.ToDictionary(e => e.Id);
            var eventIds              = eventMapping.Keys;
            var eventCategoryMappings = _eventCategoryMappingRepository.GetByEventIds(eventIds).Where(ed => ed.IsEnabled == true);
            var allEventDetails       = _eventDetailRepository.GetByEventIds(eventIds).Where(ed => ed.IsEnabled == true);
            var allEventRatings       = _ratingRepository.GetByEventIds(eventIds);
            var venueMapping          = _venueRepository.GetByVenueIds(allEventDetails.Select(ed => ed.VenueId).Distinct())
                                        .ToDictionary(v => v.Id);
            var eventDetailsMapping = allEventDetails.GroupBy(ed => ed.EventId)
                                      .ToDictionary(g => g.Key, g => g.ToList());
            var eventCategoryMapping = eventCategoryMappings.GroupBy(ed => ed.EventId)
                                       .ToDictionary(g => g.Key, g => g.ToList());
            var eventRatingMapping = allEventRatings.GroupBy(ed => ed.EventId)
                                     .ToDictionary(g => g.Key, g => g.ToList());
            var cityIds     = venueMapping.Values.Select(s => s.CityId).Distinct();
            var cityMapping = _cityRepository.GetByCityIds(cityIds)
                              .ToDictionary(c => c.Id);
            var stateId      = cityMapping.Values.Select(c => c.StateId).Distinct();
            var stateMapping = _stateRepository.GetByStateIds(stateId)
                               .ToDictionary(s => s.Id);
            var countryIdList  = stateMapping.Values.Select(s => s.CountryId).Distinct();
            var countryMapping = _countryRepository.GetByCountryIds(countryIdList)
                                 .ToDictionary(c => c.Id);
            var eventsBySortOrder = new List <FIL.Contracts.DataModels.Event>();

            foreach (var item in siteEvents)
            {
                var events = searchEvents.FirstOrDefault(w => w.Id == item.EventId);
                if (events != null)
                {
                    eventsBySortOrder.Add(AutoMapper.Mapper.Map <FIL.Contracts.DataModels.Event>(events));
                }
            }
            var CategoryEventData = eventsBySortOrder.Select(ce =>
            {
                try
                {
                    var eventObj         = eventMapping[ce.Id];
                    var eventDetails     = eventDetailsMapping[ce.Id];
                    var eventCategoryMap = eventCategoryMapping[ce.Id];
                    List <FIL.Contracts.DataModels.Rating> eventRatings;
                    if (eventRatingMapping.ContainsKey(ce.Id))
                    {
                        eventRatings = eventRatingMapping[ce.Id];
                    }
                    else
                    {
                        eventRatings = null;
                    }
                    var eventDetailIdList           = eventDetails.Select(s => s.Id).Distinct().ToList();
                    var venues                      = eventDetails.Select(s => s.VenueId).Distinct().Select(v => venueMapping[v]);
                    var cities                      = venues.Select(s => s.CityId).Distinct().Select(c => cityMapping[c]);
                    var states                      = cities.Select(s => s.StateId).Distinct().Select(s => stateMapping[s]);
                    var countries                   = states.Select(s => s.CountryId).Distinct().Select(c => countryMapping[c]);
                    var eventTicketAttributeMapping = new List <Contracts.DataModels.EventTicketAttribute>
                    {
                        _eventTicketAttributeRepository.GetMaxPriceByEventDetailId(eventDetailIdList),
                        _eventTicketAttributeRepository.GetMinPriceByEventDetailId(eventDetailIdList)
                    };
                    var currencyMapping            = _currencyTypeRepository.GetByCurrencyId(eventTicketAttributeMapping.First().CurrencyId);
                    List <string> eventCatMappings = new List <string>();

                    foreach (var eventCat in eventCategoryMap)
                    {
                        var eventCategoryDataModel = _eventCategoryRepository.Get(eventCat.EventCategoryId);
                        var eventCategoryModel     = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(eventCategoryDataModel);
                        eventCatMappings.Add(eventCategoryModel.DisplayName);
                    }
                    return(new CategoryEventContainer
                    {
                        CategoryEvent = Mapper.Map <Contracts.Models.CategoryEvent>(ce),
                        EventType = eventObj.EventTypeId.ToString(),
                        EventCategory = eventObj.EventCategoryId.ToString(),
                        City = Mapper.Map <IEnumerable <City> >(cities),
                        State = Mapper.Map <IEnumerable <State> >(states),
                        Country = Mapper.Map <IEnumerable <Country> >(countries),
                        Event = Mapper.Map <Event>(eventObj),
                        EventDetail = Mapper.Map <IEnumerable <EventDetail> >(eventDetails),
                        Rating = Mapper.Map <IEnumerable <Rating> >(eventRatings),
                        CurrencyType = Mapper.Map <CurrencyType>(currencyMapping),
                        Venue = Mapper.Map <IEnumerable <Venue> >(venues),
                        EventTicketAttribute = Mapper.Map <IEnumerable <EventTicketAttribute> >(eventTicketAttributeMapping),
                        EventCategories = eventCatMappings
                    });
                }
                catch (Exception e)
                {
                    return(new CategoryEventContainer
                    {
                    });
                }
            });

            return(new FeelSearchQueryResult
            {
                FeelAdvanceSearchQueryResult = new FeelCategoryEventQueryResult
                {
                    CategoryEvents = CategoryEventData.ToList()
                }
            });
        }
Exemple #2
0
        public CurrentOrderDataQueryResult Handle(CurrentOrderDataQuery query)
        {
            var transaction = _transactionRepository.GetByAltId(query.TransactionAltId);

            if (transaction == null)
            {
                return(new CurrentOrderDataQueryResult
                {
                });
            }

            var transactionDetails     = _transactionDetailRepository.GetByTransactionId(transaction.Id);
            var transactionDetailModel = AutoMapper.Mapper.Map <List <Contracts.Models.TransactionDetail> >(transactionDetails);

            var eventTicketAttributeDetails = _eventTicketAttributeRepository.GetByEventTicketAttributeIds(transactionDetails.Select(s => s.EventTicketAttributeId));

            var eventTicketDetails     = _eventTicketDetailRepository.GetByEventTicketDetailIds(eventTicketAttributeDetails.Select(s => s.EventTicketDetailId));
            var eventTicketDetailModel = AutoMapper.Mapper.Map <List <Contracts.Models.EventTicketDetail> >(eventTicketDetails);

            var ticketCategories = _ticketCategoryRepository.GetByTicketCategoryIds(eventTicketDetails.Select(s => s.TicketCategoryId));
            var eventDetails     = _eventDetailRepository.GetByEventDetailIds(eventTicketDetails.Select(s => s.EventDetailId).Distinct());
            var eventAttribute   = _eventAttributeRepository.GetByEventDetailIds(eventTicketDetails.Select(s => s.EventDetailId).Distinct());

            var eventDetailModel = AutoMapper.Mapper.Map <List <Contracts.Models.EventDetail> >(eventDetails);
            var venues           = _venueRepository.GetByVenueIds(eventDetailModel.Select(s => s.VenueId));
            var city             = _cityRepository.GetByCityIds(venues.Select(s => s.CityId));
            var state            = _stateRepository.GetByStateIds(city.Select(s => s.StateId));
            var country          = _countryRepository.GetByCountryIds(state.Select(s => s.CountryId));

            List <FIL.Contracts.DataModels.Event> events = events = _eventRepository.GetByAllEventIds(eventDetails.Select(s => s.EventId).Distinct()).ToList();

            var currencyDetail = _currencyTypeRepository.GetByCurrencyId(transaction.CurrencyId);
            var orderConfirmationSubContainer = events.Select(eId =>
            {
                var tEvent            = events.Where(s => s.Id == eId.Id).FirstOrDefault();
                var tEventDetail      = _eventDetailRepository.GetByEventIdAndEventDetailId(eId.Id, eventDetails.Select(edId => edId.Id)).OrderBy(s => s.StartDateTime).OrderByDescending(od => od.Id);
                var subEventContainer = tEventDetail.Select(edetail =>
                {
                    var teventCategory        = new FIL.Contracts.DataModels.EventCategory();
                    var eventCategotyMappings = _eventCategoryMappingRepository.GetByEventId(tEvent.Id).FirstOrDefault();
                    if (eventCategotyMappings != null)
                    {
                        teventCategory = _eventCategoryRepository.Get(eventCategotyMappings.EventCategoryId);
                    }
                    var tEventDetails              = eventDetails.Where(s => s.Id == edetail.Id).FirstOrDefault();
                    var tEventAttributes           = eventAttribute.Where(s => s.EventDetailId == tEventDetails.Id).FirstOrDefault();
                    var tVenue                     = venues.Where(s => s.Id == edetail.VenueId).FirstOrDefault();
                    var tCity                      = city.Where(s => s.Id == tVenue.CityId).FirstOrDefault();
                    var tState                     = state.Where(s => s.Id == tCity.StateId).FirstOrDefault();
                    var tCountry                   = country.Where(s => s.Id == tState.CountryId).FirstOrDefault();
                    var tEventTicketDetail         = _eventTicketDetailRepository.GetByEventDetailIdsAndIds(tEventDetail.Where(w => w.Id == edetail.Id).Select(s => s.Id), eventTicketDetailModel.Select(s => s.Id));
                    var tEventTicketAttribute      = eventTicketAttributeDetails.Where(x => tEventTicketDetail.Any(y => y.Id == x.EventTicketDetailId));
                    var tTicketCategory            = ticketCategories.Where(x => tEventTicketDetail.Any(y => y.TicketCategoryId == x.Id));
                    var tTransactionDetail         = transactionDetails.Where(x => tEventTicketAttribute.Any(y => y.Id == x.EventTicketAttributeId)).ToList();
                    var tEventDeliveryTypeDetail   = _eventDeliveryTypeDetailRepository.GetByEventDetailIds(tEventDetail.Select(s => s.Id));
                    var tTransactionDeliveryDetail = _transactionDeliveryDetailRepository.GetByTransactionDetailIds(tTransactionDetail.Select(s => s.Id));
                    var tUser                      = _userRepository.GetByAltId(transaction.CreatedBy);
                    var tUserAddress               = (dynamic)null;
                    if (tUser != null)
                    {
                        tUserAddress = _userAddressDetailRepository.GetByUserId(tUser.Id).LastOrDefault();
                    }
                    var tZipCode = (dynamic)null;
                    if (tUserAddress != null)
                    {
                        tZipCode = _zipcodeRepository.Get(tUserAddress.Zipcode);
                    }

                    return(new SubEventContainer
                    {
                        Event = AutoMapper.Mapper.Map <Contracts.Models.Event>(tEvent),
                        EventCategory = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(teventCategory),
                        EventAttribute = AutoMapper.Mapper.Map <Contracts.Models.EventAttribute>(tEventAttributes),
                        EventDetail = AutoMapper.Mapper.Map <Contracts.Models.EventDetail>(tEventDetails),
                        Venue = AutoMapper.Mapper.Map <Contracts.Models.Venue>(tVenue),
                        City = AutoMapper.Mapper.Map <Contracts.Models.City>(tCity),
                        State = AutoMapper.Mapper.Map <Contracts.Models.State>(tState),
                        Country = AutoMapper.Mapper.Map <Contracts.Models.Country>(tCountry),
                        Zipcode = AutoMapper.Mapper.Map <Contracts.Models.Zipcode>(tZipCode),
                        EventTicketDetail = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventTicketDetail> >(tEventTicketDetail),
                        EventTicketAttribute = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventTicketAttribute> >(tEventTicketAttribute),
                        EventDeliveryTypeDetail = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventDeliveryTypeDetail> >(tEventDeliveryTypeDetail),
                        TicketCategory = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.Models.TicketCategory> >(tTicketCategory),
                        TransactionDetail = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.TransactionDetail> >(tTransactionDetail),
                        TransactionDeliveryDetail = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.TransactionDeliveryDetail> >(tTransactionDeliveryDetail),
                    });
                });

                return(new OrderConfirmationSubContainer
                {
                    Event = AutoMapper.Mapper.Map <Contracts.Models.Event>(tEvent),
                    subEventContainer = subEventContainer.ToList()
                });
            });

            return(new CurrentOrderDataQueryResult
            {
                Transaction = AutoMapper.Mapper.Map <Contracts.Models.Transaction>(transaction),
                CurrencyType = AutoMapper.Mapper.Map <FIL.Contracts.Models.CurrencyType>(currencyDetail),
                orderConfirmationSubContainer = orderConfirmationSubContainer.ToList(),
                TicketQuantity = eventTicketAttributeDetails.ToArray().Length,
            });
        }
        public OrderConfirmationQueryResult Get(
            long transactionId,
            bool isConfirmationFromMyOrders,
            FIL.Contracts.Enums.Channels channel)
        {
            var transactionScheduleDetails = new List <FIL.Contracts.DataModels.TransactionScheduleDetail>();
            var scheduleDetails            = new List <FIL.Contracts.DataModels.ScheduleDetail>();
            var transaction = _transactionRepository.GetSuccessfulTransactionDetails(transactionId);
            var transactionModel = AutoMapper.Mapper.Map <FIL.Contracts.Models.Transaction>(transaction);
            var IsASI = false; var IsHoho = false;

            if (transactionModel == null)
            {
                return(new OrderConfirmationQueryResult());
            }

            var transactionDetails     = _transactionDetailsRepository.GetByTransactionId(transactionModel.Id);
            var transactionDetailModel = AutoMapper.Mapper.Map <List <TransactionDetail> >(transactionDetails);

            var eventTicketAttributeDetails = _eventTicketAttributeRepository.GetByEventTicketAttributeIds(transactionDetails.Select(s => s.EventTicketAttributeId));

            var eventTicketDetails     = _eventTicketDetailRepository.GetByEventTicketDetailIds(eventTicketAttributeDetails.Select(s => s.EventTicketDetailId));
            var eventTicketDetailModel = AutoMapper.Mapper.Map <List <EventTicketDetail> >(eventTicketDetails);

            var ticketCategories = _ticketCategoryRepository.GetByTicketCategoryIds(eventTicketDetails.Select(s => s.TicketCategoryId));
            var eventDetails     = _eventDetailRepository.GetByEventDetailIds(eventTicketDetails.Select(s => s.EventDetailId).Distinct());
            var eventAttribute   = _eventAttributeRepository.GetByEventDetailIds(eventTicketDetails.Select(s => s.EventDetailId).Distinct());

            var eventDetailModel = AutoMapper.Mapper.Map <List <EventDetail> >(eventDetails);
            var venues           = _venueRepository.GetByVenueIds(eventDetailModel.Select(s => s.VenueId));
            var city             = _cityRepository.GetByCityIds(venues.Select(s => s.CityId));
            var state            = _stateRepository.GetByStateIds(city.Select(s => s.StateId));
            var country          = _countryRepository.GetByCountryIds(state.Select(s => s.CountryId));

            if (channel == Contracts.Enums.Channels.Feel && eventDetailModel.FirstOrDefault().EventFrequencyType == Contracts.Enums.EventFrequencyType.Recurring)
            {
                transactionScheduleDetails = _transactionScheduleDetail.GetAllByTransactionDetails(transactionDetailModel.Select(s => s.Id).ToList()).ToList();
                scheduleDetails            = _scheduleDetailRepository.GetAllByIds(transactionScheduleDetails.Select(s => s.ScheduleDetailId).ToList()).ToList();
            }
            List <FIL.Contracts.DataModels.Event> events = new List <FIL.Contracts.DataModels.Event>();

            if (isConfirmationFromMyOrders == true)
            {
                events = _eventRepository.GetByAllEventIds(eventDetails.Select(s => s.EventId).Distinct()).ToList();
            }
            else
            {
                events = _eventRepository.GetByAllTypeEventIds(eventDetails.Select(s => s.EventId).Distinct()).ToList();
            }

            var transactionPaymentDetails = _transactionPaymentDetailRepository.GetAllByTransactionId(transactionId);
            var transactionPaymentDetail  = transactionPaymentDetails.Where(s => s.UserCardDetailId != null).FirstOrDefault();
            var currencyDetail            = _currencyTypeRepository.GetByCurrencyId(transactionModel.CurrencyId);
            var paymentOption             = (dynamic)null;
            var userCardDetail            = (dynamic)null;

            if (transactionPaymentDetail != null)
            {
                paymentOption  = transactionPaymentDetail.PaymentOptionId.ToString();
                userCardDetail = _userCardDetailRepository.GetByUserCardDetailId(transactionPaymentDetail.UserCardDetailId);
            }
            var cardTypes = (dynamic)null;

            if (userCardDetail != null)
            {
                cardTypes = userCardDetail.CardTypeId.ToString();
            }

            var orderConfirmationSubContainer = events.Select(eId =>
            {
                var tEvent       = events.Where(s => s.Id == eId.Id).FirstOrDefault();
                var tEventDetail = _eventDetailRepository.GetByEventIdAndEventDetailId(eId.Id, eventDetails.Select(edId => edId.Id)).OrderBy(s => s.StartDateTime).OrderByDescending(od => od.Id);

                var subEventContainer = tEventDetail.Select(edetail =>
                {
                    var teventCategory = new FIL.Contracts.DataModels.EventCategory();
                    if (channel == FIL.Contracts.Enums.Channels.Feel)
                    {
                        var eventCategotyMappings = _eventCategoryMappingRepository.GetByEventId(tEvent.Id).FirstOrDefault();
                        if (eventCategotyMappings != null)
                        {
                            teventCategory = _eventCategoryRepository.Get(eventCategotyMappings.EventCategoryId);
                        }
                    }
                    else
                    {
                        teventCategory = _eventCategoryRepository.Get(tEvent.EventCategoryId);
                    }
                    var tEventDetails    = eventDetails.Where(s => s.Id == edetail.Id).FirstOrDefault();
                    var tEventAttributes = eventAttribute.Where(s => s.EventDetailId == tEventDetails.Id).FirstOrDefault();
                    var tVenue           = venues.Where(s => s.Id == edetail.VenueId).FirstOrDefault();
                    var tCity            = city.Where(s => s.Id == tVenue.CityId).FirstOrDefault();
                    var tState           = state.Where(s => s.Id == tCity.StateId).FirstOrDefault();
                    var tCountry         = country.Where(s => s.Id == tState.CountryId).FirstOrDefault();

                    var tEventTicketDetail = _eventTicketDetailRepository.GetByEventDetailIdsAndIds(tEventDetail.Where(w => w.Id == edetail.Id).Select(s => s.Id), eventTicketDetailModel.Select(s => s.Id));

                    var tEventTicketAttribute = eventTicketAttributeDetails.Where(x => tEventTicketDetail.Any(y => y.Id == x.EventTicketDetailId));

                    var tTicketCategory = ticketCategories.Where(x => tEventTicketDetail.Any(y => y.TicketCategoryId == x.Id));

                    var tTransactionDetail = transactionDetails.Where(x => tEventTicketAttribute.Any(y => y.Id == x.EventTicketAttributeId)).ToList();
                    List <MatchLayoutSectionSeat> tMatchLayoutSectionSeats = new List <MatchLayoutSectionSeat>();
                    List <FIL.Contracts.DataModels.MatchLayoutCompanionSeatMapping> tMatchLayoutCompanionSeatMapping = new List <FIL.Contracts.DataModels.MatchLayoutCompanionSeatMapping>();

                    var tMatchSeatTicketDetails = _matchSeatTicketDetailRepository.GetByTransactionIdAndTicketDetailIds(tTransactionDetail.Select(w => w.TransactionId).FirstOrDefault(), tEventTicketDetail.Select(w => w.Id));
                    if (tMatchSeatTicketDetails.Any())
                    {
                        var matchSeatTicketDetails = tMatchSeatTicketDetails.Where(w => w.MatchLayoutSectionSeatId != null).FirstOrDefault();
                        if (matchSeatTicketDetails != null)
                        {
                            tMatchLayoutSectionSeats         = AutoMapper.Mapper.Map <List <MatchLayoutSectionSeat> >(_matchLayoutSectionSeatRepository.GetByIds(tMatchSeatTicketDetails.Select(s => (long)s.MatchLayoutSectionSeatId).Distinct()));
                            tMatchLayoutCompanionSeatMapping = AutoMapper.Mapper.Map <List <FIL.Contracts.DataModels.MatchLayoutCompanionSeatMapping> >(_matchLayoutCompanionSeatMappingRepository.GetByWheelChairSeatIds(tMatchLayoutSectionSeats.Select(s => s.Id).Distinct()));
                        }
                    }

                    var taSITransactionDetailTimeSlotIdMapping = _aSITransactionDetailTimeSlotIdMappingRepository.GetByTransactionDetailIds(tTransactionDetail.Select(s => s.Id));
                    var tGuestDetails = _guestDetailRepository.GetByTransactionDetailIds(tTransactionDetail.Select(s => s.Id));
                    var taSIPaymentResponseDetailTicketMappings = _aSIPaymentResponseDetailTicketMappingRepository.GetByVisitorIds(tGuestDetails.Select(s => (long)s.Id).ToList());
                    var teventTimeSlotMapping = _eventTimeSlotMappingRepository.GetByIds(taSITransactionDetailTimeSlotIdMapping.Select(s => s.EventTimeSlotMappingId));
                    if (tEvent.EventSourceId == Contracts.Enums.EventSource.ASI)
                    {
                        IsASI = true;
                        foreach (FIL.Contracts.DataModels.TransactionDetail currentTransacitionDetail in tTransactionDetail)
                        {
                            var visitDate = (DateTime)currentTransacitionDetail.VisitDate;
                            currentTransacitionDetail.VisitDate = visitDate.AddHours(5).AddMinutes(30);
                        }
                    }

                    if (tEvent.EventSourceId == Contracts.Enums.EventSource.CitySightSeeing)
                    {
                        IsHoho = true;
                    }
                    var tEventDeliveryTypeDetail = _eventDeliveryTypeDetailRepository.GetByEventDetailIds(tEventDetail.Select(s => s.Id));

                    var tTransactionDeliveryDetail = _transactionDeliveryDetailRepository.GetByTransactionDetailIds(tTransactionDetail.Select(s => s.Id));

                    var tUser        = _userRepository.GetByAltId(transaction.CreatedBy);
                    var tUserAddress = (dynamic)null;
                    if (tUser != null)
                    {
                        tUserAddress = _userAddressDetailRepository.GetByUserId(tUser.Id).LastOrDefault();
                    }
                    var tZipCode = (dynamic)null;
                    if (tUserAddress != null)
                    {
                        tZipCode = _zipcodeRepository.Get(tUserAddress.Zipcode);
                    }
                    var transctionScheduleDetails = transactionScheduleDetails.Where(s => tTransactionDetail.Any(x => x.Id == s.TransactionDetailId)).ToList();
                    var scheduleDetail            = scheduleDetails.Where(s => transctionScheduleDetails.Any(x => x.ScheduleDetailId == s.Id)).ToList();
                    return(new SubEventContainer
                    {
                        Event = AutoMapper.Mapper.Map <Event>(tEvent),
                        EventCategory = AutoMapper.Mapper.Map <EventCategory>(teventCategory),
                        EventAttribute = AutoMapper.Mapper.Map <EventAttribute>(tEventAttributes),
                        EventDetail = AutoMapper.Mapper.Map <EventDetail>(tEventDetails),
                        Venue = AutoMapper.Mapper.Map <Venue>(tVenue),
                        City = AutoMapper.Mapper.Map <City>(tCity),
                        State = AutoMapper.Mapper.Map <State>(tState),
                        Country = AutoMapper.Mapper.Map <Country>(tCountry),
                        Zipcode = AutoMapper.Mapper.Map <Zipcode>(tZipCode),
                        EventTicketDetail = AutoMapper.Mapper.Map <IEnumerable <EventTicketDetail> >(tEventTicketDetail),
                        EventTicketAttribute = AutoMapper.Mapper.Map <IEnumerable <EventTicketAttribute> >(tEventTicketAttribute),
                        EventDeliveryTypeDetail = AutoMapper.Mapper.Map <IEnumerable <EventDeliveryTypeDetail> >(tEventDeliveryTypeDetail),
                        TicketCategory = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.Models.TicketCategory> >(tTicketCategory),
                        TransactionDetail = AutoMapper.Mapper.Map <IEnumerable <TransactionDetail> >(tTransactionDetail),
                        MatchSeatTicketDetail = AutoMapper.Mapper.Map <IEnumerable <MatchSeatTicketDetail> >(tMatchSeatTicketDetails),
                        MatchLayoutSectionSeat = AutoMapper.Mapper.Map <IEnumerable <MatchLayoutSectionSeat> >(tMatchLayoutSectionSeats),
                        MatchLayoutCompanionSeatMappings = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.DataModels.MatchLayoutCompanionSeatMapping> >(tMatchLayoutCompanionSeatMapping),
                        TransactionDeliveryDetail = AutoMapper.Mapper.Map <IEnumerable <TransactionDeliveryDetail> >(tTransactionDeliveryDetail),
                        EventTimeSlotMappings = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.Models.ASI.EventTimeSlotMapping> >(teventTimeSlotMapping),
                        ASITransactionDetailTimeSlotIdMappings = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.Models.ASI.ASITransactionDetailTimeSlotIdMapping> >(taSITransactionDetailTimeSlotIdMapping),
                        ASIPaymentResponseDetailTicketMappings = AutoMapper.Mapper.Map <IEnumerable <FIL.Contracts.Models.ASI.ASIPaymentResponseDetailTicketMapping> >(taSIPaymentResponseDetailTicketMappings),
                        TransactionScheduleDetails = transctionScheduleDetails,
                        ScheduleDetails = scheduleDetail
                    });
                });

                return(new OrderConfirmationSubContainer
                {
                    Event = AutoMapper.Mapper.Map <Event>(tEvent),
                    subEventContainer = subEventContainer.ToList()
                });
            });

            decimal TotalGst      = 0;
            decimal GST           = 0;
            decimal AdditionalGST = 0;

            try
            {
                if (transactionModel != null)
                {
                    if (orderConfirmationSubContainer.Any() && orderConfirmationSubContainer.ToList().ElementAt(0).Event.AltId.ToString().ToUpper() == "1F0257FA-EEA6-4469-A7BC-B878A215C8A9") //RASV Email
                    {
                        TotalGst = (decimal)transactionModel.ConvenienceCharges / 11;
                    }
                }
            }
            catch (Exception e)
            {
            }

            return(new OrderConfirmationQueryResult
            {
                Transaction = transactionModel,
                TransactionPaymentDetail = AutoMapper.Mapper.Map <FIL.Contracts.Models.TransactionPaymentDetail>(transactionPaymentDetail),
                UserCardDetail = AutoMapper.Mapper.Map <FIL.Contracts.Models.UserCardDetail>(userCardDetail),
                CurrencyType = AutoMapper.Mapper.Map <FIL.Contracts.Models.CurrencyType>(currencyDetail),
                PaymentOption = paymentOption,
                GoodsAndServiceTax = TotalGst,
                cardTypes = cardTypes,
                orderConfirmationSubContainer = orderConfirmationSubContainer.ToList(),
                TicketQuantity = eventTicketAttributeDetails.ToArray().Length,
                IsASI = IsASI,
                IsHoho = IsHoho
            });
        }
Exemple #4
0
        public RecommendationQueryResult Handle(RecommendationQuery query)
        {
            var sessionResponseIA     = _initSession.GetSession().Result;
            RecommendationModel model = new RecommendationModel
            {
                ClientType    = "web_site",
                Count         = 4,
                SessionId     = sessionResponseIA.Result.SessionId,
                SitePageType  = "product_detail",
                siteProductId = query.Id,
            };
            var recommendations     = _getRecommendation.GetRecommendations(model).Result;
            var recomendationResult = AutoMapper.Mapper.Map <List <RecommendationItem> >(recommendations.Result.Data[0].Items);
            var recommendationIds   = recomendationResult.Select(e => e.SiteProductId);

            var siteEvents            = _eventSiteIdMappingRepository.GetBySiteId(query.SiteId).OrderBy(o => o.SortOrder);
            var categoryEvents        = _eventRepository.GetByCategoryId(query.EventCategoryId).Where(e => e.IsEnabled == true);
            var categoryEventsForSite = categoryEvents.Where(ce => recommendationIds.Any(se => se == (ce.Id)));
            var eventIds        = categoryEventsForSite.Select(ce => ce.Id);
            var eventMapping    = _eventRepository.GetByEventIds(eventIds).Where(e => e.IsEnabled == true).ToDictionary(e => e.Id);
            var allEventDetails = _eventDetailRepository.GetByEventIds(eventIds).Where(ed => ed.IsEnabled == true);
            var venueMapping    = _venueRepository.GetByVenueIds(allEventDetails.Select(ed => ed.VenueId).Distinct())
                                  .ToDictionary(v => v.Id);
            var eventDetailsMapping = allEventDetails.GroupBy(ed => ed.EventId)
                                      .ToDictionary(g => g.Key, g => g.ToList());
            var cityIds     = venueMapping.Values.Select(s => s.CityId).Distinct();
            var cityMapping = _cityRepository.GetByCityIds(cityIds)
                              .ToDictionary(c => c.Id);
            var stateId      = cityMapping.Values.Select(c => c.StateId).Distinct();
            var stateMapping = _stateRepository.GetByStateIds(stateId)
                               .ToDictionary(s => s.Id);
            var countryIdList  = stateMapping.Values.Select(s => s.CountryId).Distinct();
            var countryMapping = _countryRepository.GetByCountryIds(countryIdList)
                                 .ToDictionary(c => c.Id);
            var CategoryEventData = categoryEventsForSite.Select(ce =>
            {
                var eventObj                    = eventMapping[ce.Id];
                var eventDetails                = eventDetailsMapping[ce.Id];
                var eventDetailIdList           = eventDetails.Select(s => s.Id).Distinct();
                var venues                      = eventDetails.Select(s => s.VenueId).Distinct().Select(v => venueMapping[v]);
                var cities                      = venues.Select(s => s.CityId).Distinct().Select(c => cityMapping[c]);
                var states                      = cities.Select(s => s.StateId).Distinct().Select(s => stateMapping[s]);
                var countries                   = states.Select(s => s.CountryId).Distinct().Select(c => countryMapping[c]);
                var eventTicketAttributeMapping = new List <Contracts.DataModels.EventTicketAttribute>
                {
                    _eventTicketAttributeRepository.GetMaxPriceByEventDetailId(eventDetailIdList),
                    _eventTicketAttributeRepository.GetMinPriceByEventDetailId(eventDetailIdList)
                };
                var currencyMapping = _currencyTypeRepository.GetByCurrencyId(eventTicketAttributeMapping.First().CurrencyId);
                return(new CategoryEventContainer
                {
                    CategoryEvent = Mapper.Map <Contracts.Models.CategoryEvent>(ce),
                    EventType = eventObj.EventTypeId.ToString(),
                    City = Mapper.Map <IEnumerable <City> >(cities),
                    State = Mapper.Map <IEnumerable <State> >(states),
                    Country = Mapper.Map <IEnumerable <Country> >(countries),
                    Event = Mapper.Map <Event>(eventObj),
                    EventDetail = Mapper.Map <IEnumerable <EventDetail> >(eventDetails),
                    CurrencyType = Mapper.Map <CurrencyType>(currencyMapping),
                    Venue = Mapper.Map <IEnumerable <Venue> >(venues),
                    EventTicketAttribute = Mapper.Map <IEnumerable <EventTicketAttribute> >(eventTicketAttributeMapping),
                });
            });

            return(new RecommendationQueryResult
            {
                CategoryEvents = CategoryEventData.ToList()
            });
        }
        public FeelEventLearnPageQueryResult Handle(FeelEventLearnPageQuery query)
        {
            EventLearnPageQueryResults eventLearnMorePage = new EventLearnPageQueryResults();

            if (!String.IsNullOrWhiteSpace(query.Slug))
            {
                eventLearnMorePage = _eventLearnPageProvider.GetBySlug(query.Slug);
            }
            else
            {
                eventLearnMorePage = _eventLearnPageProvider.GetByAltId(query.EventAltId);
            }

            if (eventLearnMorePage.Event != null)
            {
                var eventCategoryMappings = _eventCategoryMappingRepository.GetByEventId(eventLearnMorePage.Event.Id).FirstOrDefault();
                if (eventCategoryMappings == null)
                {
                    return(new FeelEventLearnPageQueryResult());
                }
                var subCategoryDataModel = _eventCategoryRepository.Get(eventCategoryMappings.EventCategoryId);
                var subCategory          = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(subCategoryDataModel);
                var categoryDataModel    = _eventCategoryRepository.Get(subCategory.EventCategoryId);
                var category             = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(categoryDataModel);

                var clientPointOfContact      = _clientPointOfContactRepository.Get(eventLearnMorePage.Event.ClientPointOfContactId);
                var clientPointOfContactModel = AutoMapper.Mapper.Map <Contracts.Models.ClientPointOfContact>(clientPointOfContact);

                var eventTicketDetails     = _eventTicketDetailRepository.GetByEventDetailId(eventLearnMorePage.EventDetail.Id).Where(s => s.IsEnabled == true);
                var EventTicketDetailModel = AutoMapper.Mapper.Map <List <Contracts.Models.EventTicketDetail> >(eventTicketDetails);

                var eventTicketCategories      = _ticketCategoryRepository.GetByTicketCategoryIds(eventTicketDetails.Select(s => s.TicketCategoryId).Distinct());
                var eventTicketCategoriesModel = AutoMapper.Mapper.Map <List <Contracts.Models.TicketCategory> >(eventTicketCategories);

                var eventTicketAttributes      = _eventTicketAttributeRepository.GetByEventTicketDetailId(eventTicketDetails.Select(s => s.Id).Distinct());
                var eventTicketAttributesModel = AutoMapper.Mapper.Map <List <Contracts.Models.EventTicketAttribute> >(eventTicketAttributes);
                if (eventTicketAttributesModel.Count() == 0)
                {
                    return(new FeelEventLearnPageQueryResult {
                    });
                }
                var currencyMapping = _currencyTypeRepository.GetByCurrencyId(eventTicketAttributesModel.First().CurrencyId);

                var ratingDataModel = _ratingRepository.GetByEventId(eventLearnMorePage.Event.Id);
                var ratingModel     = AutoMapper.Mapper.Map <List <Contracts.Models.Rating> >(ratingDataModel);

                var userdataModel = _userRepository.GetByUserIds(ratingModel.Select(s => s.UserId).Distinct());
                var userModel     = AutoMapper.Mapper.Map <List <Contracts.Models.UserProfile> >(userdataModel);

                var           eventAmenities           = _eventAmenityRepository.GetByEventId(eventLearnMorePage.Event.Id);
                var           eventLearnMoreAttributes = _eventLearnMoreAttributeRepository.GetByEventId(eventLearnMorePage.Event.Id);
                var           learnMoreAttributes      = AutoMapper.Mapper.Map <List <Contracts.Models.EventLearnMoreAttribute> >(eventLearnMoreAttributes);
                var           ticketAlertEventMapping  = _ticketAlertEventMappingRepository.GetByEventId(eventCategoryMappings.EventId).FirstOrDefault();
                List <string> EventAmenitiesList       = new List <string>();
                foreach (var item in eventAmenities)
                {
                    var amenities = _amenityRepository.Get(item.AmenityId);
                    EventAmenitiesList.Add((amenities.Amenity).ToString());
                }
                var data = _calendarProvider.GetCalendarData(eventLearnMorePage.Event.Id);
                //For Hoho Routes
                var citySightSeeingRoute        = _citySightSeeingRouteRepository.GetByEventDetailId(eventLearnMorePage.EventDetail.Id);
                var citySightSeeingRouteDetails = _citySightSeeingRouteDetailRepository.GetByCitySightSeeingRouteIds(citySightSeeingRoute.Select(s => s.Id));

                //for Tiqets Places
                Contracts.Models.Tiqets.TiqetProductCheckoutDetail
                    tiqetCheckoutDetailsModel = new Contracts.Models.Tiqets.TiqetProductCheckoutDetail();
                if (eventLearnMorePage.Event.EventSourceId == EventSource.Tiqets)
                {
                    var tiqetEventDetailMapping = _tiqetEventDetailMappingRepository.GetByEventDetailId(eventLearnMorePage.EventDetail.Id);
                    var tiqetCheckoutDetails    = _tiqetProductCheckoutDetailRepository.GetByProductId(tiqetEventDetailMapping.ProductId);
                    tiqetCheckoutDetailsModel = Mapper.Map <Contracts.Models.Tiqets.TiqetProductCheckoutDetail>(tiqetCheckoutDetails);
                }

                //For Live Online Events
                List <EventHostMapping> eventHostMappings = new List <EventHostMapping>();
                DateTime formattedDateTime = new DateTime();
                string   eventDateTimeZome = string.Empty;
                if (eventLearnMorePage.Event.MasterEventTypeId == MasterEventType.Online)
                {
                    var eventHostMappingModel = _eventHostMappingRepository.GetAllByEventId(eventLearnMorePage.Event.Id);
                    eventHostMappings = AutoMapper.Mapper.Map <List <Contracts.Models.EventHostMapping> >(eventHostMappingModel);
                    var placeWeekOpenDays = _placeWeekOpenDaysRepository.GetByEventId(eventLearnMorePage.Event.Id).FirstOrDefault();
                    var dayTimeMapping    = _dayTimeMappingsRepository.GetAllByPlaceWeekOpenDay(placeWeekOpenDays.Id).FirstOrDefault();
                    var eventAttribute    = _eventAttributeRepository.GetByEventDetailId(eventLearnMorePage.EventDetail.Id);

                    //Getting Datetime for online Event
                    var eventDate      = _localTimeZoneConvertProvider.ConvertToLocal(eventLearnMorePage.EventDetail.StartDateTime, eventAttribute.TimeZone);
                    var dateTimeString = eventDate.ToString("yyyy/MM/dd") + " " + dayTimeMapping.StartTime + ":00.000";
                    formattedDateTime = DateTime.Parse(dateTimeString);

                    eventDateTimeZome = eventAttribute.TimeZoneAbbreviation;
                }
                return(new FeelEventLearnPageQueryResult
                {
                    EventType = (EventType)eventLearnMorePage.EventType,
                    EventCategory = eventLearnMorePage.EventCategory,
                    Event = eventLearnMorePage.Event,
                    EventDetail = eventLearnMorePage.EventDetail,
                    Venue = eventLearnMorePage.Venue,
                    City = eventLearnMorePage.City,
                    State = eventLearnMorePage.State,
                    Country = eventLearnMorePage.Country,
                    EventTicketAttribute = eventTicketAttributesModel,
                    EventTicketDetail = EventTicketDetailModel,
                    CurrencyType = Mapper.Map <CurrencyType>(currencyMapping),
                    Rating = ratingModel,
                    TicketCategory = eventTicketCategoriesModel,
                    User = userModel,
                    EventAmenitiesList = EventAmenitiesList,
                    ClientPointOfContact = clientPointOfContactModel,
                    EventGalleryImage = eventLearnMorePage.EventGalleryImage,
                    EventLearnMoreAttributes = learnMoreAttributes,
                    RegularTimeModel = data.RegularTimeModel,
                    SeasonTimeModel = data.SeasonTimeModel,
                    SpecialDayModel = data.SpecialDayModel,
                    Category = category,
                    SubCategory = subCategory,
                    CitySightSeeingRoutes = Mapper.Map <IEnumerable <FIL.Contracts.Models.CitySightSeeing.CitySightSeeingRoute> >(citySightSeeingRoute),
                    CitySightSeeingRouteDetails = Mapper.Map <IEnumerable <FIL.Contracts.Models.CitySightSeeing.CitySightSeeingRouteDetail> >(citySightSeeingRouteDetails),
                    TiqetsCheckoutDetails = tiqetCheckoutDetailsModel,
                    EventHostMappings = eventHostMappings,
                    OnlineStreamStartTime = formattedDateTime,
                    OnlineEventTimeZone = eventDateTimeZome,
                    TicketAlertEventMapping = ticketAlertEventMapping
                });
            }
            return(new FeelEventLearnPageQueryResult());
        }
Exemple #6
0
        public FeelCategoryEventQueryResult Handle(FeelCategoryEventQuery query)
        {
            try
            {
                query.SiteId = FIL.Contracts.Enums.Site.feelaplaceSite;
                var countryDescription = new FIL.Contracts.DataModels.CountryDescription();
                var cityDescription    = new FIL.Contracts.DataModels.CityDescription();
                var countryContents    = new List <FIL.Contracts.DataModels.CountryContentMapping>();
                var indexEventId       = eventIdProvider(query);
                var siteEvents         = _eventSiteIdMappingRepository
                                         .GetBySiteId(query.SiteId)
                                         .OrderBy(o => o.SortOrder).ToList();
                var categoryEvents = _eventRepository.GetByAllEventIds(indexEventId)
                                     .Where(e => e.IsEnabled)
                                     .ToList();

                var eventMapping = categoryEvents.ToDictionary(e => e.Id);

                var eventIds = eventMapping.Keys;
                var eventCategoryMappings = _eventCategoryMappingRepository.GetByEventIds(eventIds).Where(ed => ed.IsEnabled == true);
                var allEventDetails       = _eventDetailRepository.GetByEventIds(eventIds).Where(ed => ed.IsEnabled == true);
                var allEventAttributes    = _eventAttributeRepository.GetByEventDetailIds(allEventDetails.Select(s => s.Id));
                var allEventTicketDetails = _eventTicketDetailRepository.GetAllByEventDetailIds(allEventDetails.Select(s => s.Id));
                var allEventTicketDetailTicketCategoryTypeMapping = _eventTicketDetailTicketCategoryTypeMappingRepository.GetByEventTicketDetails(allEventTicketDetails.Select(s => s.Id).ToList()).Where(s => s.TicketCategoryTypeId == 2);
                allEventTicketDetails = allEventTicketDetails.Where(s => allEventTicketDetailTicketCategoryTypeMapping.All(p => p.EventTicketDetailId != s.Id));
                var allLiveEventDetails = _liveEventDetailRepository.GetAllByEventIds(eventIds.ToList());
                var allEventRatings     = _ratingRepository.GetByEventIds(eventIds);
                var venueMapping        = _venueRepository.GetByVenueIds(allEventDetails.Select(ed => ed.VenueId).Distinct())
                                          .ToDictionary(v => v.Id);
                var eventDetailsMapping = allEventDetails.GroupBy(ed => ed.EventId)
                                          .ToDictionary(g => g.Key, g => g.ToList());
                var eventCategoryMapping = eventCategoryMappings.GroupBy(ed => ed.EventId)
                                           .ToDictionary(g => g.Key, g => g.ToList());
                var eventRatingMapping = allEventRatings.GroupBy(ed => ed.EventId)
                                         .ToDictionary(g => g.Key, g => g.ToList());

                var cityIds      = venueMapping.Values.Select(s => s.CityId).Distinct();
                var allCities    = _cityRepository.GetByCityIds(cityIds);
                var cityMapping  = allCities.ToDictionary(c => c.Id);
                var stateId      = cityMapping.Values.Select(c => c.StateId).Distinct();
                var stateMapping = _stateRepository.GetByStateIds(stateId)
                                   .ToDictionary(s => s.Id);
                var countryIdList  = stateMapping.Values.Select(s => s.CountryId).Distinct();
                var countryMapping = _countryRepository.GetByCountryIds(countryIdList)
                                     .ToDictionary(c => c.Id);
                if (query.IsCountryLandingPage)
                {
                    if (countryIdList.ToList().Any())
                    {
                        countryDescription = _countryDescriptionRepository.GetByCountryId(countryIdList.ToList().ElementAt(0));
                        countryContents    = _countryContentMappingRepository.GetByCountryId(countryIdList.ToList().ElementAt(0)).ToList();
                    }
                }
                if (query.IsCityLandingPage)
                {
                    if (cityIds.ToList().Any())
                    {
                        var cities = _cityRepository.GetAllByName(allCities.ElementAt(0).Name);
                        foreach (var currentCity in allCities)
                        {
                            cityDescription = _cityDescriptionRepository.GetBycityId(currentCity.Id);
                            if (cityDescription != null)
                            {
                                break;
                            }
                        }
                    }
                }
                var eventsBySortOrder = new List <FIL.Contracts.DataModels.Event>();
                foreach (var item in siteEvents)
                {
                    var events = categoryEvents.FirstOrDefault(w => w.Id == item.EventId);
                    if (events != null)
                    {
                        eventsBySortOrder.Add(AutoMapper.Mapper.Map <FIL.Contracts.DataModels.Event>(events));
                    }
                }
                eventsBySortOrder = eventsBySortOrder.Where(s => !s.IsTokenize).ToList();
                var CategoryEventData = eventsBySortOrder.Select(ce =>
                {
                    try
                    {
                        var eventObj           = eventMapping[ce.Id];
                        var EventCategory      = eventObj.EventCategoryId.ToString();
                        var parentCategory     = "";
                        var eventDetails       = eventDetailsMapping[ce.Id];
                        var eventAttribute     = allEventAttributes.Where(s => s.EventDetailId == eventDetails.FirstOrDefault().Id).FirstOrDefault();
                        var eventTicketDetails = allEventTicketDetails.Where(s => eventDetails.Exists(p => p.Id == s.EventDetailId));
                        var eventCategoryMap   = eventCategoryMapping[ce.Id];
                        if (eventCategoryMap.Any())
                        {
                            var eventCategory = _eventCategoryRepository.Get(eventCategoryMap.FirstOrDefault().EventCategoryId);
                            if (eventCategory != null)
                            {
                                EventCategory           = eventCategory.Slug;
                                var parentCategoryModel = _eventCategoryRepository.Get(eventCategory.EventCategoryId);
                                parentCategory          = parentCategoryModel.Slug;
                            }
                        }
                        List <FIL.Contracts.DataModels.Rating> eventRatings;
                        if (eventRatingMapping.ContainsKey(ce.Id))
                        {
                            eventRatings = eventRatingMapping[ce.Id];
                        }
                        else
                        {
                            eventRatings = null;
                        }
                        var eventDetailIdList       = eventDetails.Select(s => s.Id).Distinct().ToList();
                        var eventTicketDetailIdList = eventTicketDetails.Select(s => s.Id).Distinct().ToList();
                        var venues    = eventDetails.Select(s => s.VenueId).Distinct().Select(v => venueMapping[v]);
                        var cities    = venues.Select(s => s.CityId).Distinct().Select(c => cityMapping[c]);
                        var states    = cities.Select(s => s.StateId).Distinct().Select(s => stateMapping[s]);
                        var countries = states.Select(s => s.CountryId).Distinct().Select(c => countryMapping[c]);
                        var eventTicketAttributeMapping = new List <Contracts.DataModels.EventTicketAttribute>
                        {
                            _eventTicketAttributeRepository.GetMaxPriceByEventTicketDetailId(eventTicketDetailIdList),
                            _eventTicketAttributeRepository.GetMinPriceByEventTicketDetailId(eventTicketDetailIdList)
                        };
                        var currencyMapping            = _currencyTypeRepository.GetByCurrencyId(eventTicketAttributeMapping.Where(s => s.IsEnabled == true).ToList().First().CurrencyId);
                        List <string> eventCatMappings = new List <string>();
                        var eventCategoryDataModel     = _eventCategoryRepository.GetByIds(eventCategoryMap.Select(s => s.EventCategoryId));
                        foreach (var eventCat in eventCategoryDataModel)
                        {
                            eventCatMappings.Add(eventCat.DisplayName);
                        }
                        var localDateTime = eventDetails.FirstOrDefault().StartDateTime.DayOfWeek + ", " + eventDetails.FirstOrDefault().StartDateTime.ToString(@"MMM dd, yyyy HH:mm", new CultureInfo("en-US")).ToUpper();
                        if (eventAttribute != null)
                        {
                            localDateTime = eventDetails.FirstOrDefault().StartDateTime.DayOfWeek + ", " + _localTimeZoneConvertProvider.ConvertToLocal(eventDetails.FirstOrDefault().StartDateTime, eventAttribute.TimeZone).ToString(@"MMM dd, yyyy HH:mm", new CultureInfo("en-US")).ToUpper();
                        }

                        return(new CategoryEventContainer
                        {
                            CategoryEvent = Mapper.Map <Contracts.Models.CategoryEvent>(ce),
                            EventType = eventObj.EventTypeId.ToString(),
                            EventCategory = EventCategory,
                            City = Mapper.Map <IEnumerable <City> >(cities),
                            State = Mapper.Map <IEnumerable <State> >(states),
                            Country = Mapper.Map <IEnumerable <Country> >(countries),
                            Event = Mapper.Map <Event>(eventObj),
                            EventDetail = Mapper.Map <IEnumerable <EventDetail> >(eventDetails),
                            Rating = Mapper.Map <IEnumerable <Rating> >(eventRatings),
                            CurrencyType = Mapper.Map <CurrencyType>(currencyMapping),
                            Venue = Mapper.Map <IEnumerable <Venue> >(venues),
                            EventTicketAttribute = Mapper.Map <IEnumerable <EventTicketAttribute> >(eventTicketAttributeMapping),
                            EventCategories = eventCatMappings,
                            LocalStartDateTime = localDateTime,
                            TimeZoneAbbrivation = eventAttribute != null ? eventAttribute.TimeZoneAbbreviation : "UTC",
                            EventFrequencyType = eventDetails.FirstOrDefault().EventFrequencyType,
                            ParentCategory = parentCategory,
                            LiveEventDetail = allLiveEventDetails.Where(s => s.EventId == ce.Id).FirstOrDefault()
                        });
                    }
                    catch (Exception e)
                    {
                        return(new CategoryEventContainer
                        {
                        });
                    }
                });

                return(new FeelCategoryEventQueryResult
                {
                    CategoryEvents = CategoryEventData.ToList(),
                    CountryDescription = Mapper.Map <Contracts.Models.CountryDescription>(countryDescription),
                    CityDescription = cityDescription,
                    CountryContentMapping = Mapper.Map <List <CountryContentMapping> >(countryContents)
                });
            }
            catch (Exception e)
            {
                return(new FeelCategoryEventQueryResult
                {
                });
            }
        }