Esempio n. 1
0
 public EventHostQueryResult Handle(EventHostQuery query)
 {
     try
     {
         var eventData = _eventRepository.Get(query.EventId);
         if (eventData == null)
         {
             return(new EventHostQueryResult {
                 Success = true
             });
         }
         var eventHostMappings = _eventHostMappingRepository.GetAllByEventId(query.EventId).ToList();
         return(new EventHostQueryResult
         {
             Success = true,
             EventId = query.EventId,
             IsValidLink = true,
             IsDraft = false,
             EventHostMapping = eventHostMappings
         });
     }
     catch (Exception e)
     {
         return(new EventHostQueryResult {
         });
     }
 }
Esempio n. 2
0
        private bool InsertUsers(LiveOnlineTransactionDetailResponseModel liveOnlineTransactionDetailModel)
        {
            var eventHostUsers = _eventHostMappingRepository.GetAllByEventId(liveOnlineTransactionDetailModel.EventId);

            foreach (var currentHost in eventHostUsers)
            {
                _zoomUserRepository.Save(new Contracts.DataModels.ZoomUser
                {
                    AltId           = System.Guid.NewGuid(),
                    RoleId          = 21, //check for prod host role Id
                    IsActive        = false,
                    IsEnabled       = true,
                    EventHostUserId = currentHost.Id,
                    EventId         = liveOnlineTransactionDetailModel.EventId,
                    ModifiedBy      = liveOnlineTransactionDetailModel.CreatorAltId
                });
            }
            return(true);
        }
        public FeelOrderConfirmationQueryResult Handle(FeelOrderConfirmationQuery query)
        {
            var transaction = _transactionRepository.GetByAltId(query.TransactionAltId);

            if (transaction == null)
            {
                return(new FeelOrderConfirmationQueryResult
                {
                });
            }
            var orderConfirmation = _orderConfirmationProvider.Get(transaction.Id,
                                                                   query.confirmationFrmMyOrders,
                                                                   query.Channel);

            // Check if transaction is Tiqets One
            var tiqetsTransactions = _tiqetsTransactionRepository.GetByTransactionId(transaction.Id);

            //for live online events
            var IsLiveOnline                        = false;
            var zoomUserModel                       = new ZoomUser();
            var liveOnlineDetailModelData           = new LiveOnlineTransactionDetailResponseModel();
            List <ZoomHostUserModel> hostUsersModel = new List <ZoomHostUserModel>();
            var liveOnlineDetailModel               = _transactionRepository.GetFeelOnlineDetails(transaction.Id);

            if (liveOnlineDetailModel.Any() &&
                liveOnlineDetailModel.Count() == 1 &&
                (liveOnlineDetailModel.Select(s => s.TicketCategoryId).Contains(19452) || liveOnlineDetailModel.Select(s => s.TicketCategoryId).Contains(12259)))
            {
                liveOnlineDetailModelData = liveOnlineDetailModel.FirstOrDefault();
            }
            else
            {
                liveOnlineDetailModelData = liveOnlineDetailModel.Where(s => s.TransactionType == Contracts.Enums.TransactionType.LiveOnline).FirstOrDefault();
            }
            if (liveOnlineDetailModelData != null && liveOnlineDetailModelData.EventcategoryId != 0)
            {
                if (orderConfirmation.orderConfirmationSubContainer.Any(s => s.Event.MasterEventTypeId == Contracts.Enums.MasterEventType.Online))
                {
                    IsLiveOnline  = true;
                    zoomUserModel = _zoomUserRepository.GetByTransactionId(transaction.Id);
                    if (zoomUserModel != null)
                    {
                        var transactionCount = _transactionRepository.GetTransactionCountByEvent(liveOnlineDetailModelData.EventId);
                        if (transactionCount == 1)
                        {
                            var eventHostUsersModel = _eventHostMappingRepository.GetAllByEventId(liveOnlineDetailModelData.EventId);
                            var zoomHostUserModel   = _zoomUserRepository.GetByHostUserIds(eventHostUsersModel.Select(s => s.Id));
                            foreach (var currentZoomUser in zoomHostUserModel)
                            {
                                var currentHostUsersModel = new ZoomHostUserModel();
                                var currentEventHost      = eventHostUsersModel.Where(s => s.Id == currentZoomUser.EventHostUserId).FirstOrDefault();
                                currentHostUsersModel.altId = currentZoomUser.AltId;
                                currentHostUsersModel.email = currentEventHost.Email;
                                hostUsersModel.Add(currentHostUsersModel);
                            }
                        }
                    }
                }
            }

            return(new FeelOrderConfirmationQueryResult
            {
                Transaction = orderConfirmation.Transaction,
                TransactionPaymentDetail = orderConfirmation.TransactionPaymentDetail,
                UserCardDetail = orderConfirmation.UserCardDetail,
                CurrencyType = orderConfirmation.CurrencyType,
                PaymentOption = orderConfirmation.PaymentOption,
                cardTypes = orderConfirmation.cardTypes,
                orderConfirmationSubContainer = orderConfirmation.orderConfirmationSubContainer,
                IsTiqets = tiqetsTransactions != null ? true : false,
                IsHoho = orderConfirmation.IsHoho,
                ZoomUser = zoomUserModel,
                liveOnlineDetailModel = liveOnlineDetailModelData,
                hostUsersModel = hostUsersModel,
                IsLiveOnline = IsLiveOnline
            });
        }
Esempio n. 4
0
        public SavedEventQueryResult Handle(SavedEventQuery query)
        {
            var eventDataModel = _eventRepository.GetByAltId(query.Id);
            var eventModel     = AutoMapper.Mapper.Map <Contracts.Models.Event>(eventDataModel);

            var placeVisitDuration = _placeVisitDurationRepository.GetBySingleEventId(eventModel.Id);

            var galleryImageResponse = _eventGalleryImageRepository.GetByEventId(eventModel.Id);
            var galleryImageModel    = AutoMapper.Mapper.Map <IEnumerable <EventGalleryImage> >(galleryImageResponse);

            var eventcatmapresponse = _eventCategoryMappingRepository.GetByEventId(eventModel.Id);
            var eventcatmap         = AutoMapper.Mapper.Map <IEnumerable <EventCategoryMapping> >(eventcatmapresponse);

            var eventsiteidresponse = _eventSiteIdMappingRepository.GetByEventId(eventModel.Id);
            var eventsitemap        = AutoMapper.Mapper.Map <EventSiteIdMapping>(eventsiteidresponse);

            var eventlearnmoreresponse = _eventLearnMoreAttributeRepository.GetByEventId(eventModel.Id);
            var eventlearnmore         = AutoMapper.Mapper.Map <IEnumerable <EventLearnMoreAttribute> >(eventlearnmoreresponse);

            var eventamenityresponse = _eventAmenityRepository.GetByEventId(eventModel.Id);
            var eventamenity         = AutoMapper.Mapper.Map <IEnumerable <EventAmenity> >(eventamenityresponse);

            var eventdetailresponse = _eventDetailRepository.GetSubeventByEventId(eventModel.Id).FirstOrDefault();
            var eventdetail         = AutoMapper.Mapper.Map <EventDetail>(eventdetailresponse);

            var eventTags = _eventTagMappingRepository.GetByEventId(eventModel.Id);

            Country countrydetail = new Country();
            City    citydetail    = new City();
            State   statedetail   = new State();
            Zipcode zipcodeDetail = new Zipcode();
            Venue   venuedetail   = new Venue();

            if (eventdetail != null)
            {
                var venuedetailresponse = _venueRepository.GetByVenueId(eventdetail.VenueId);
                venuedetail = AutoMapper.Mapper.Map <Venue>(venuedetailresponse);
                if (venuedetail != null)
                {
                    var citydetailresponse = _cityRepository.GetByCityId(venuedetail.CityId);
                    citydetail = AutoMapper.Mapper.Map <City>(citydetailresponse);
                    var Zip = _zipcodeRepository.GetAllByCityId(citydetail.Id).FirstOrDefault();
                    zipcodeDetail = AutoMapper.Mapper.Map <Zipcode>(Zip);
                }
                if (citydetail != null)
                {
                    var statedetailresponse = _stateRepository.GetByStateId(citydetail.StateId);
                    statedetail = AutoMapper.Mapper.Map <State>(statedetailresponse);
                }
                if (statedetail != null)
                {
                    var countrydetailresponse = _countryRepository.GetByCountryId(statedetail.CountryId);
                    countrydetail = AutoMapper.Mapper.Map <Country>(countrydetailresponse);
                }
            }

            var features   = Enum.GetValues(typeof(LearnMoreFeatures));
            var resultdata = new SavedEventQueryResult();

            resultdata.Country  = countrydetail.Name;
            resultdata.City     = citydetail.Name;
            resultdata.Address1 = venuedetail.AddressLineOne;
            resultdata.Address2 = venuedetail.AddressLineTwo;
            resultdata.State    = statedetail.Name;
            resultdata.Lat      = ((venuedetail.Latitude != null && venuedetail.Latitude != "" && venuedetail.Latitude != "NaN") ? venuedetail.Latitude : "18.5204");
            resultdata.Long     = ((venuedetail.Longitude != null && venuedetail.Longitude != "" && venuedetail.Latitude != "NaN") ? venuedetail.Longitude : "73.8567");
            List <string> amenityids = new List <string>();

            if (zipcodeDetail != null)
            {
                if (zipcodeDetail.Id != 0)
                {
                    resultdata.Zip = zipcodeDetail.Postalcode;
                }
            }
            foreach (var ea in eventamenity)
            {
                amenityids.Add((ea.AmenityId).ToString());
            }
            if (placeVisitDuration != null)
            {
                var data = placeVisitDuration.TimeDuration.Split("-");
                if (data.Length >= 2)
                {
                    resultdata.HourTimeDuration   = placeVisitDuration.TimeDuration;
                    resultdata.MinuteTimeDuration = "";
                }
            }
            resultdata.AmenityId = string.Join(",", amenityids);
            //resultdata.AmenityId = string.Join(",", amenityids);
            var archdesc = eventlearnmore.FirstOrDefault(p => p.LearnMoreFeatureId == LearnMoreFeatures.ArchitecturalDetail);

            if (archdesc != null)
            {
                resultdata.Archdetail   = archdesc.Description;
                resultdata.ArchdetailId = archdesc.Id;
            }
            var highlightdesc = eventlearnmore.FirstOrDefault(p => p.LearnMoreFeatureId == LearnMoreFeatures.HighlightNugget);

            if (highlightdesc != null)
            {
                resultdata.Highlights   = highlightdesc.Description;
                resultdata.HighlightsId = highlightdesc.Id;
            }
            var historydesc = eventlearnmore.FirstOrDefault(p => p.LearnMoreFeatureId == LearnMoreFeatures.History);

            if (historydesc != null)
            {
                resultdata.History   = historydesc.Description;
                resultdata.HistoryId = historydesc.Id;
            }
            var immersdesc = eventlearnmore.FirstOrDefault(p => p.LearnMoreFeatureId == LearnMoreFeatures.ImmersiveExperience);

            if (immersdesc != null)
            {
                resultdata.Immersiveexperience   = immersdesc.Description;
                resultdata.ImmersiveexperienceId = immersdesc.Id;
            }

            var tilesImages         = "";
            var galleryImages       = galleryImageModel.Where(p => p.Name.Contains("gallery"));
            var tilesSliderImages   = galleryImageModel.Where(p => p.Name.Contains("Tiles"));
            var descPageImages      = galleryImageModel.Where(p => p.Name.Contains("DescBanner"));
            var inventoryPageImages = galleryImageModel.Where(p => p.Name.Contains("InventoryBanner"));
            var placeMapImages      = galleryImageModel.Where(p => p.Name.Contains("placemapImages"));
            var timelineImages      = galleryImageModel.Where(p => p.Name.Contains("timelineImages"));
            var immersiveImages     = galleryImageModel.Where(p => p.Name.Contains("immersiveImages"));
            var architecturalImages = galleryImageModel.Where(p => p.Name.Contains("archdetailImages"));

            var galleryImagesList     = "";
            var tilesSliderImagesList = "";
            var descPageList          = "";
            var inventoryPageList     = "";
            var plaeMapImagesList     = "";
            var timelineImagesList    = "";
            var immerseImagesList     = "";
            var archImagesList        = "";

            foreach (EventGalleryImage eventGalleryImage in galleryImages)
            {
                galleryImagesList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in tilesSliderImages)
            {
                tilesSliderImagesList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in descPageImages)
            {
                descPageList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in inventoryPageImages)
            {
                inventoryPageList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in placeMapImages)
            {
                plaeMapImagesList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in timelineImages)
            {
                timelineImagesList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in immersiveImages)
            {
                immerseImagesList += eventGalleryImage.Name + ",";
            }
            foreach (EventGalleryImage eventGalleryImage in galleryImages)
            {
                archImagesList += eventGalleryImage.Name + ",";
            }

            resultdata.GalleryImages            = galleryImagesList;
            resultdata.TilesSliderImages        = tilesSliderImagesList;
            resultdata.DescpagebannerImage      = descPageList;
            resultdata.InventorypagebannerImage = inventoryPageList;
            resultdata.PlacemapImages           = plaeMapImagesList;
            resultdata.TimelineImages           = timelineImagesList;
            resultdata.ImmersiveexpImages       = immerseImagesList;
            resultdata.ArchdetailImages         = archImagesList;

            resultdata.Description = eventModel.Description;
            resultdata.Id          = eventModel.Id;
            resultdata.AltId       = eventModel.AltId;
            resultdata.Location    = eventModel.Name;
            List <int> subcatids  = new List <int>();
            List <int> tags       = new List <int>();
            int        categoryId = eventModel.EventCategoryId;

            foreach (var cat in eventcatmap)
            {
                categoryId = cat.EventCategoryId;
                subcatids.Add(cat.EventCategoryId);
            }
            foreach (var tag in eventTags)
            {
                tags.Add((int)tag.TagId);
            }
            var category = _eventCategoryRepository.Get(categoryId);

            resultdata.Subcategoryid = string.Join(",", subcatids);
            resultdata.TagIds        = string.Join(",", tags);
            resultdata.Categoryid    = category.EventCategoryId;
            //resultdata.Subcategoryid = subcatids.FirstOrDefault();

            /*var categorymapobj = eventcatmap.FirstOrDefault();
             * if (categorymapobj != null)
             * {
             *  resultdata.Categoryid = eventModel.EventCategoryId;
             * }*/
            resultdata.Metadescription = eventModel.MetaDetails;
            if (resultdata.Metadescription != null)
            {
                string[] metas = resultdata.Metadescription.Split(new string[] { "<br/>" }, StringSplitOptions.None);
                if (metas.Length == 3)
                {
                    resultdata.Metatitle       = metas[0].Split("title")[1].Replace(">", "").Replace("</", "");
                    resultdata.Metadescription = metas[1].Split("content=")[1].Replace(">", "").Replace("\"", "").Replace("</", "");
                    resultdata.Metatags        = metas[2].Split("content=")[1].Replace(">", "").Replace("\"", "").Replace("</", "");
                }
            }
            resultdata.PlaceName = venuedetail.Name;
            //resultdata.Subcategoryid = eventcatmap.Select(p => p.EventCategoryId).FirstOrDefault();
            //resultdata.Subcategoryid = string.Join(",", eventcatmap.Count() > 0 ? eventcatmap.Select(p => p.EventCategoryId).ToList() : new List<int>());
            resultdata.Title = eventModel.Name;
            var eventHostMappings = _eventHostMappingRepository.GetAllByEventId(eventModel.Id);

            resultdata.EventHostMappings = eventHostMappings.ToList();
            return(resultdata);
        }
Esempio n. 5
0
        protected override async Task <ICommandResult> Handle(ZoomValidateUserCommand command)
        {
            ZoomValidateUserCommandResult zoomValidateUserCommandResult = new ZoomValidateUserCommandResult();

            try
            {
                var zoomUserModel = _zoomUserRepository.GetByAltId(command.AltId);
                var getTimeStamp  = GetTimeStamp(zoomUserModel);
                zoomValidateUserCommandResult.timeStamp = getTimeStamp;
                //var checkTimeStamp = CheckValidTimeStamp(zoomUserModel);
                //if (!checkTimeStamp.IsValid)
                //{
                //    zoomValidateUserCommandResult.message = checkTimeStamp.Message;
                //    zoomValidateUserCommandResult.success = false;
                //    return zoomValidateUserCommandResult;
                //}
                if (zoomUserModel == null)
                {
                    if (zoomUserModel == null)
                    {
                        zoomValidateUserCommandResult.message = Constant.Zoom.Message.Invalid;
                    }
                    else
                    {
                        zoomValidateUserCommandResult.message = Constant.Zoom.Message.Active;
                    }
                    zoomValidateUserCommandResult.success = false;
                    return(zoomValidateUserCommandResult);
                }
                else
                {
                    string apikey    = _settings.GetConfigSetting <string>(SettingKeys.Integration.Zoom.API_Key);
                    string apiSecret = _settings.GetConfigSetting <string>(SettingKeys.Integration.Zoom.Secret_key);

                    var zoomMeetingModel = _zoomMeetingRepository.GetByEventId(zoomUserModel.EventId);

                    //Interactivity levels available
                    zoomValidateUserCommandResult.isAudioAvailable = true;
                    zoomValidateUserCommandResult.isVideoAvailable = true;
                    zoomValidateUserCommandResult.isChatAvailable  = true;

                    bool isHost         = false;
                    var  access         = Access.None;
                    var  eventHostModel = new EventHostMapping();
                    if (zoomUserModel.RoleId != 21 && zoomUserModel.RoleId != 26) // If the user is attendee
                    {
                        var userModel = _userRepository.Get(zoomUserModel.UserId);
                        zoomValidateUserCommandResult.email     = userModel.Email;
                        zoomValidateUserCommandResult.userName  = userModel.FirstName + " " + userModel.LastName;
                        zoomValidateUserCommandResult.UserAltId = userModel.AltId;
                        var transactionDetailsModel = _transactionRepository.GetFeelOnlineDetails(zoomUserModel.TransactionId).Where(s => s.TransactionType == Contracts.Enums.TransactionType.LiveOnline).FirstOrDefault();
                        if (transactionDetailsModel == null)
                        {
                            return(zoomValidateUserCommandResult);
                        }
                        //interactivity levels available based on ticket cat.
                        if (transactionDetailsModel.TicketCategoryId == 1360)
                        {
                            access = Access.GA;
                            zoomValidateUserCommandResult.isAudioAvailable = false;
                            zoomValidateUserCommandResult.isVideoAvailable = false;
                            zoomValidateUserCommandResult.isChatAvailable  = false;
                        }
                        if (transactionDetailsModel.TicketCategoryId == 606)
                        {
                            access = Access.VIP;
                            zoomValidateUserCommandResult.isAudioAvailable = false;
                            zoomValidateUserCommandResult.isVideoAvailable = false;
                        }
                        if (transactionDetailsModel.TicketCategoryId == 12080 || transactionDetailsModel.TicketCategoryId == 19352)
                        {
                            zoomValidateUserCommandResult.isVideoAvailable = false;
                        }
                    }
                    else // Host user
                    {
                        eventHostModel = _eventHostMappingRepository.Get(zoomUserModel.EventHostUserId);
                        zoomValidateUserCommandResult.email    = eventHostModel.Email;
                        zoomValidateUserCommandResult.userName = eventHostModel.FirstName + " " + eventHostModel.LastName;
                        isHost = true;
                    }

                    zoomValidateUserCommandResult.meetingNumber = zoomMeetingModel.MeetingNumber.ToString();
                    zoomValidateUserCommandResult.apikey        = apikey;
                    zoomValidateUserCommandResult.secretkey     = apiSecret;
                    zoomValidateUserCommandResult.success       = true;
                    zoomValidateUserCommandResult.roleId        = (zoomUserModel.RoleId == 21 || zoomUserModel.RoleId == 26) ? "1" : "0";

                    if (!zoomUserModel.IsActive && command.IsZoomLandingPage)
                    {
                        zoomUserModel.UniqueId = command.UniqueId;
                        zoomUserModel.IsActive = true;
                        _zoomUserRepository.Save(zoomUserModel);
                    }
                    var eventDetail = _eventDetailRepository.GetAllByEventId(zoomUserModel.EventId).FirstOrDefault();
                    zoomValidateUserCommandResult.eventName = eventDetail.Name;
                    if (!command.IsZoomLandingPage)
                    {
                        zoomValidateUserCommandResult.EventAttribute    = _eventAttributeRepository.GetByEventDetailId(eventDetail.Id);
                        zoomValidateUserCommandResult.EventHostMappings = _eventHostMappingRepository.GetAllByEventId(eventDetail.EventId).OrderBy(s => s.StartDateTime).ToList();
                        foreach (var currentEHM in zoomValidateUserCommandResult.EventHostMappings)
                        {
                            currentEHM.StartDateTime = currentEHM.StartDateTime != null?_localTimeZoneConvertProvider.ConvertToLocal((DateTime)currentEHM.StartDateTime, zoomValidateUserCommandResult.EventAttribute.TimeZone) : currentEHM.StartDateTime;

                            currentEHM.EndDateTime = currentEHM.EndDateTime != null?_localTimeZoneConvertProvider.ConvertToLocal((DateTime)currentEHM.EndDateTime, zoomValidateUserCommandResult.EventAttribute.TimeZone) : currentEHM.EndDateTime;
                        }
                        zoomValidateUserCommandResult.EventDetail     = _eventDetailRepository.Get(eventDetail.Id);
                        zoomValidateUserCommandResult.LiveEventDetail = _liveEventDetailRepository.GetByEventId(eventDetail.EventId);
                        if (isHost && eventHostModel.StartDateTime != null && zoomValidateUserCommandResult.LiveEventDetail != null)
                        {
                            zoomValidateUserCommandResult.LiveEventDetail.EventStartDateTime = eventHostModel.StartDateTime;
                        }
                        zoomValidateUserCommandResult.Event = _eventRepository.Get(eventDetail.EventId);
                        var eventTicketDetails    = _eventTicketDetailRepository.GetByEventDetailId(eventDetail.Id).Where(s => s.IsEnabled).ToList();
                        var eventTicketAttributes = _eventTicketAttributeRepository.GetByEventTicketDetailIds(eventTicketDetails.Select(s => s.Id)).Where(s => s.IsEnabled).ToList();
                        if (eventTicketDetails.Select(s => s.TicketCategoryId).Contains(19452) || eventTicketDetails.Select(s => s.TicketCategoryId).Contains(12259)) // if donate
                        {
                            zoomValidateUserCommandResult.IsDonate = true;
                        }
                        if ((access == Access.GA || access == Access.VIP) && eventTicketDetails.Select(s => s.TicketCategoryId).Contains(19350) || eventTicketDetails.Select(s => s.TicketCategoryId).Contains(12079)) // if BSP Exists
                        {
                            var price       = getBSPPrice(eventTicketDetails, eventTicketAttributes) - (access == Access.GA ? getGAPrice(eventTicketDetails, eventTicketAttributes) : getVIP(eventTicketDetails, eventTicketAttributes));
                            var transacions = _transactionRepository.GetAllSuccessfulTransactionByReferralId(zoomUserModel.TransactionId.ToString());
                            if (price >= 0 && !transacions.Any())
                            {
                                zoomValidateUserCommandResult.IsUpgradeToBSP = true;
                                zoomValidateUserCommandResult.Price          = price;
                            }
                        }
                        if (zoomUserModel.RoleId != 21 && zoomUserModel.RoleId != 26) // If the user is attendee
                        {
                            var transactionDetail = _transactionDetailRepository.GetByTransactionId(zoomUserModel.TransactionId);
                            var eta = _eventTicketAttributeRepository.Get(transactionDetail.Count() > 1 ? transactionDetail.Where(s => s.TransactionType == Contracts.Enums.TransactionType.LiveOnline).FirstOrDefault().EventTicketAttributeId : transactionDetail.FirstOrDefault().EventTicketAttributeId);
                            zoomValidateUserCommandResult.ImportantInformation = eta.TicketCategoryNotes;
                            /* If Recurring then update Event Start & Interactivity start time */
                            if (eventDetail.EventFrequencyType == Contracts.Enums.EventFrequencyType.Recurring)
                            {
                                UpdateEventSchedule(zoomValidateUserCommandResult, transactionDetail.ToList());
                            }
                        }
                        else
                        {
                            zoomValidateUserCommandResult.ImportantInformation = zoomValidateUserCommandResult.EventHostMappings.Where(s => s.Id == zoomUserModel.EventHostUserId).FirstOrDefault().ImportantInformation;
                        }
                    }
                }
                zoomValidateUserCommandResult.success       = true;
                zoomValidateUserCommandResult.TransactionId = zoomUserModel.TransactionId;
                return(zoomValidateUserCommandResult);
            }
            catch (Exception e)
            {
                _logger.Log(LogCategory.Error, new Exception("Failed to validate zoom details " + e.Message, e));
                return(zoomValidateUserCommandResult);
            }
        }
Esempio n. 6
0
        public TicketCategoryQueryResult Handle(TicketCategoryQuery query)
        {
            try
            {
                var eventDataModel = _eventRepository.GetByAltId(query.EventAltId);
                var eventModel     = AutoMapper.Mapper.Map <Contracts.Models.Event>(eventDataModel);
                if (eventModel != null)
                {
                    var ASIMonumentMapping = _aSIMonumentEventTableMappingRepository.GetByEventId(eventModel.Id);
                    var ASIMonument        = new Contracts.Models.ASI.Item();
                    if (ASIMonumentMapping != null)
                    {
                        ASIMonument = Mapper.Map <Contracts.Models.ASI.Item>(_aSIMonumentRepository.Get(ASIMonumentMapping.ASIMonumentId));
                    }
                    var eventCategoryMappings     = _eventCategoryMappingRepository.GetByEventId(eventModel.Id).FirstOrDefault();
                    var eventDetailModelDataModel = _eventDetailRepository.GetSubEventByEventId(eventModel.Id);
                    var eventDetailModel          = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventDetail> >(eventDetailModelDataModel);
                    List <FIL.Contracts.Models.ASI.EventTimeSlotMapping> eventTimeSlotMappings = new List <Contracts.Models.ASI.EventTimeSlotMapping>();
                    List <EventVenueMappingTime>       eventVenueMappingTimeModel = new List <EventVenueMappingTime>();
                    FIL.Contracts.Models.EventCategory subCategory = new FIL.Contracts.Models.EventCategory();
                    FIL.Contracts.Models.EventCategory category    = new FIL.Contracts.Models.EventCategory();
                    try
                    {
                        var eventTimeSlot = _eventTimeSlotMappingRepository.GetByEventId(eventModel.Id);
                        eventTimeSlotMappings = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.ASI.EventTimeSlotMapping> >(eventTimeSlot).ToList();
                    }
                    catch (Exception e)
                    {
                    }
                    if (eventCategoryMappings != null)
                    {
                        var subCategoryDataModel = _eventCategoryRepository.Get(eventCategoryMappings.EventCategoryId);
                        if (subCategory != null)
                        {
                            subCategory = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(subCategoryDataModel);
                            var categoryDataModel = _eventCategoryRepository.Get(subCategory.EventCategoryId);
                            category = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(categoryDataModel);
                        }
                    }
                    var ticketCategoryType    = _ticketCategoryTypesRepository.GetAll();
                    var ticketCategorySubType = _ticketCategorySubTypesRepository.GetAll();

                    var placeHolidyDatesDataModel = _placeHolidayDatesRepository.GetAllByEventId(eventDataModel.Id);
                    var placeHolidyDatesModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.PlaceHolidayDate> >(placeHolidyDatesDataModel);

                    var placeWeekOffDataModel = _placeWeekOffRepository.GetAllByEventId(eventDataModel.Id);
                    var placeWeekOffModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.PlaceWeekOff> >(placeWeekOffDataModel);

                    var placeDocumentDataModel = _placeCustomerDocumentTypeMappingRepository.GetAllByEventId(eventDataModel.Id);
                    var placeDocumentModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.PlaceCustomerDocumentTypeMapping> >(placeDocumentDataModel);

                    var placeOpenDays      = _placeWeekOpenDaysRepository.GetByEventId(eventDataModel.Id);
                    var placeOpenDaysModel = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.PlaceWeekOpenDays> >(placeOpenDays);

                    var CustomerDocumentTypeDataModel = _customerDocumentTypeRepository.GetAll();
                    var CustomerDocumentTypeModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.CustomerDocumentType> >(CustomerDocumentTypeDataModel);

                    if (eventDetailModelDataModel != null && eventDetailModelDataModel.Any())
                    {
                        var eventDeliveryTypeDetailDataModel = _eventDeliveryTypeDetail.GetByEventDetailId(eventDetailModelDataModel.ElementAt(0).Id);
                        var eventDeliveryTypeDetailModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventDeliveryTypeDetail> >(eventDeliveryTypeDetailDataModel);

                        var RASVTicketTypeMappingsDataModel = _rasvTicketTypeMappingRepository.GetByEventDetailIds(eventDetailModelDataModel.Select(ed => ed.Id)).Where(sed => sed.IsEnabled == true);
                        var RASVTicketTypeMappingsModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.RASVTicketTypeMapping> >(RASVTicketTypeMappingsDataModel);

                        var venueDetailDataModel = _venueRepository.GetByVenueIds(eventDetailModel.Select(s => s.VenueId));
                        var venueDetailModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.Venue> >(venueDetailDataModel);

                        //Multiple Venue option for MOVE AROUND category.
                        var eventVenueMappingDataModel = _eventVenueMappingRepository.GetOneByEventId(eventModel.Id);
                        var eventVenueMappingModel     = Mapper.Map <EventVenueMapping>(eventVenueMappingDataModel);
                        if (eventVenueMappingModel != null)
                        {
                            var eventVenueMappingTimeDataModel = _eventVenueMappingTimeRepository.GetAllByEventVenueMappingId(eventVenueMappingModel.Id);
                            eventVenueMappingTimeModel = Mapper.Map <IEnumerable <EventVenueMappingTime> >(eventVenueMappingTimeDataModel).ToList();
                        }

                        var CityList            = venueDetailDataModel.Select(s => s.CityId);
                        var cityDetailDataModel = _cityRepository.GetByCityIds(CityList);
                        var cityModel           = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.City> >(cityDetailDataModel);

                        var eventTicketDetailList      = eventDetailModelDataModel.Select(s => s.Id);
                        var eventTicketDetailDataModel = _eventTicketDetailRepository.GetByEventDetailIds(eventTicketDetailList);
                        var eventTicketDetailModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventTicketDetail> >(eventTicketDetailDataModel);

                        // For Getting Pone venue Images
                        var pOneImageEventDetailMapping = new List <Contracts.Models.POne.POneImageEventDetailMapping>();
                        if (eventModel.EventSourceId == EventSource.POne)
                        {
                            var pOneEventDetailMappings = _pOneEventDetailMappingRepository.GetByEventDetailIds(eventTicketDetailModel.Select(s => s.EventDetailId).Distinct().ToList());
                            var allTicketCategories     = _ticketCategoryRepository.GetByTicketCategoryIds(eventTicketDetailModel.Select(s => s.TicketCategoryId).Distinct().ToList());
                            var allPoneETD = _pOneEventTicketDetailRepository.GetByManyPOneEventDetail(pOneEventDetailMappings.Select(s => s.POneEventDetailId).Distinct().ToList());
                            foreach (var item in eventTicketDetailModel)
                            {
                                var pOneEventDetailMappingData = pOneEventDetailMappings.Where(s => s.ZoongaEventDetailId == item.EventDetailId).FirstOrDefault();
                                var tc   = allTicketCategories.Where(s => s.Id == item.TicketCategoryId).FirstOrDefault();
                                var p1tc = _pOneTicketCategoryRepository.GetByName(tc.Name);
                                if (pOneEventDetailMappingData != null && p1tc != null)
                                {
                                    var p1etd = allPoneETD.Where(s => (s.POneEventDetailId == pOneEventDetailMappingData.POneEventDetailId && s.POneTicketCategoryId == p1tc.POneId)).FirstOrDefault();
                                    if (p1etd != null)
                                    {
                                        pOneImageEventDetailMapping.Add(new Contracts.Models.POne.POneImageEventDetailMapping
                                        {
                                            EventTicketDetailId = item.Id,
                                            ImageUrl            = p1etd.ImageUrl
                                        });
                                    }
                                }
                            }
                        }

                        var eventTicketDetailTicketCategoryMappings      = _eventTicketDetailTicketCategoryTypeMappingRepository.GetByEventTicketDetails(eventTicketDetailModel.Select(s => s.Id).ToList());
                        var eventTicketDetailTicketCategoryMappingsModel = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventTicketDetailTicketCategoryTypeMapping> >(eventTicketDetailTicketCategoryMappings).ToList();

                        var matchAttribute = _matchAttributeRepository.GetByEventDetailIds(eventDetailModelDataModel.Select(ed => ed.Id).Distinct());
                        var team           = _teamRepository.GetAll();
                        var data           = _calendarProvider.GetCalendarData(eventModel.Id);
                        if (eventTicketDetailModel != null)
                        {
                            var ticketCategoryIdList    = eventTicketDetailModel.Select(s => s.TicketCategoryId);
                            var ticketCategoryDataModel = _ticketCategoryRepository.GetByEventDetailIds(ticketCategoryIdList);
                            var ticketCategoryModel     = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.TicketCategory> >(ticketCategoryDataModel);

                            var eventTicketDetailIdList      = eventTicketDetailModel.Select(s => s.Id);
                            var eventTicketDetailIdDataModel = _eventTicketAttributeRepository.GetByEventTicketDetailId(eventTicketDetailIdList);
                            var eventTicketAttributeModel    = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.EventTicketAttribute> >(eventTicketDetailIdDataModel);

                            var eventTicketAttributeIdList = eventTicketAttributeModel.Select(s => s.Id);
                            var ticketFeeDetailIdDataModel = _ticketFeeDetail.GetByEventTicketAttributeIds(eventTicketAttributeIdList);
                            var ticketFeeDetailModel       = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.TicketFeeDetail> >(ticketFeeDetailIdDataModel);

                            var currencyList  = eventTicketAttributeModel.Select(s => s.CurrencyId).Distinct().FirstOrDefault();
                            var currencyModel = AutoMapper.Mapper.Map <Contracts.Models.CurrencyType>(_currencyTypeRepository.Get(currencyList));

                            var days      = _daysRepository.GetAll();
                            var daysModel = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.Days> >(days);

                            var CountryRegionalOrganisation = _countryRegionalOrganisationMappingRepository.GetAll();

                            var eventAttribute = _eventAttributeRepository.GetByEventDetailIds(eventDetailModel.Select(s => (long)s.Id).ToList());

                            var           Country             = _countryRepository.GetAll();
                            var           Countrymodel        = AutoMapper.Mapper.Map <IEnumerable <Contracts.Models.Country> >(Country);
                            List <string> reginalOrganisation = new List <string>();
                            reginalOrganisation.AddRange(Enum.GetNames(typeof(FIL.Contracts.Enums.RegionalOrganisation)));

                            // For Tiqet's gettting Checkout Details
                            TiqetProductCheckoutDetail
                                tiqetCheckoutDetailsModel = new TiqetProductCheckoutDetail();
                            List <ValidWithVariantModel> validWithVariantList = new List <ValidWithVariantModel>();
                            if (eventModel.EventSourceId == EventSource.Tiqets)
                            {
                                var tiqetEventDetailMapping = _tiqetEventDetailMappingRepository.GetByEventDetailId(eventDetailModel.ElementAt(0).Id);
                                var tiqetCheckoutDetails    = _tiqetProductCheckoutDetailRepository.GetByProductId(tiqetEventDetailMapping.ProductId);
                                tiqetCheckoutDetailsModel = Mapper.Map <TiqetProductCheckoutDetail>(tiqetCheckoutDetails);
                                // for checking valid with tiqetVariant details
                                var tiqetVariantDetails = _tiqetVariantDetailRepository.GetAllByProductId(tiqetCheckoutDetailsModel.ProductId);

                                List <long> eventTicketDetailIds = new List <long>();
                                foreach (var currentVariantDetail in tiqetVariantDetails)
                                {
                                    if (currentVariantDetail.ValidWithVariantIds != null && currentVariantDetail.ValidWithVariantIds != "")
                                    {
                                        ValidWithVariantModel validWithVariantModel = new ValidWithVariantModel();
                                        var validWithVariantIds = currentVariantDetail.ValidWithVariantIds.Split(",");
                                        foreach (var currentValidvariantId in validWithVariantIds)
                                        {
                                            var currentValidVariantDetail = tiqetVariantDetails.Where(s => s.VariantId == Convert.ToInt64(currentValidvariantId)).FirstOrDefault();
                                            if (currentValidVariantDetail != null)
                                            {
                                                var eventTicketDetailMapping = _tiqetEventTicketDetailMappingRepository.GetByTiqetVariantId(currentValidVariantDetail.Id);
                                                eventTicketDetailIds.Add(eventTicketDetailMapping.EventTicketDetailId);
                                            }
                                        }
                                        var currentEventTicketDetailMapping = _tiqetEventTicketDetailMappingRepository.GetByTiqetVariantId(currentVariantDetail.Id);
                                        validWithVariantModel.EventTicketDetailId          = currentEventTicketDetailMapping.EventTicketDetailId;
                                        validWithVariantModel.ValidWithEventTicketDetailId = eventTicketDetailIds;
                                        validWithVariantList.Add(validWithVariantModel);
                                    }
                                }
                            }
                            // Check for Hoho Places if any
                            FIL.Contracts.DataModels.CitySightSeeingTicketDetail citySightSeeingTicketDetail = new FIL.Contracts.DataModels.CitySightSeeingTicketDetail();
                            var citySightSeeingEventDetailMapping = _citySightSeeingEventDetailMappingRepository.GetByEventDetailId(eventDetailModel.ElementAt(0).Id);
                            if (citySightSeeingEventDetailMapping != null)
                            {
                                var citySightSeeingTickets = _citySightSeeingTicketRepository.Get(citySightSeeingEventDetailMapping.CitySightSeeingTicketId);
                                citySightSeeingTicketDetail = _citySightSeeingTicketDetailRepository.GetByTicketId(citySightSeeingTickets.TicketId);
                            }
                            //Get Host Details for FIL Online Events
                            var eventHostMappingList = new List <FIL.Contracts.DataModels.EventHostMapping>();
                            var formattedDateString  = "";
                            if (eventDataModel.MasterEventTypeId == MasterEventType.Online)
                            {
                                eventHostMappingList = _eventHostMappingRepository.GetAllByEventId(eventDataModel.Id).ToList();
                                var formattedDateTime = _localTimeZoneConvertProvider.ConvertToLocal(eventDetailModel.FirstOrDefault().StartDateTime, eventAttribute.FirstOrDefault().TimeZone);
                                formattedDateString = formattedDateTime.DayOfWeek + ", " + formattedDateTime.ToString(@"MMM dd, yyyy, hh:mm tt", new CultureInfo("en-US"));
                            }
                            //Get Recurrance Schedule
                            List <FIL.Contracts.Models.CreateEventV1.EventRecurranceScheduleModel> recurranceScheduleModels = new List <Contracts.Models.CreateEventV1.EventRecurranceScheduleModel>();
                            if (eventDetailModel.FirstOrDefault().EventFrequencyType == EventFrequencyType.Recurring)
                            {
                                recurranceScheduleModels = _getScheduleDetailProvider.GetScheduleDetails(eventDataModel.Id, DateTime.UtcNow, DateTime.UtcNow, false, true).Where(s => s.EndDateTime > DateTime.UtcNow).ToList();
                            }
                            try
                            {
                                return(new TicketCategoryQueryResult
                                {
                                    Event = eventModel,
                                    EventDetail = eventDetailModel,
                                    EventTicketAttribute = eventTicketAttributeModel,
                                    TicketFeeDetail = ticketFeeDetailModel,
                                    Venue = venueDetailModel,
                                    City = cityModel,
                                    EventTicketDetail = eventTicketDetailModel,
                                    TicketCategory = ticketCategoryModel,
                                    CurrencyType = currencyModel,
                                    RASVTicketTypeMappings = RASVTicketTypeMappingsModel,
                                    EventDeliveryTypeDetails = eventDeliveryTypeDetailModel,
                                    EventCategory = eventModel.EventCategoryId,
                                    MatchAttribute = Mapper.Map <IEnumerable <MatchAttribute> >(matchAttribute),
                                    Team = Mapper.Map <IEnumerable <Team> >(team),
                                    PlaceCustomerDocumentTypeMappings = placeDocumentModel,
                                    PlaceHolidayDates = placeHolidyDatesModel,
                                    PlaceWeekOffs = placeWeekOffModel,
                                    CustomerDocumentTypes = CustomerDocumentTypeModel,
                                    TicketCategorySubTypes = ticketCategorySubType.ToList(),
                                    TicketCategoryTypes = ticketCategoryType.ToList(),
                                    EventTicketDetailTicketCategoryTypeMappings = eventTicketDetailTicketCategoryMappingsModel,
                                    EventCategoryMappings = eventCategoryMappings,
                                    RegularTimeModel = data.RegularTimeModel,
                                    SeasonTimeModel = data.SeasonTimeModel,
                                    SpecialDayModel = data.SpecialDayModel,
                                    EventVenueMappings = eventVenueMappingModel,
                                    EventVenueMappingTimes = eventVenueMappingTimeModel,
                                    EventTimeSlotMappings = eventTimeSlotMappings,
                                    PlaceWeekOpenDays = placeOpenDaysModel,
                                    Days = daysModel,
                                    CountryRegionalOrganisationMappings = CountryRegionalOrganisation.ToList(),
                                    Countries = Countrymodel,
                                    Category = category,
                                    SubCategory = subCategory,
                                    RegionalOrganisation = reginalOrganisation,
                                    TiqetsCheckoutDetails = tiqetCheckoutDetailsModel,
                                    ValidWithVariantModel = validWithVariantList,
                                    CitySightSeeingTicketDetail = Mapper.Map <FIL.Contracts.Models.CitySightSeeing.CitySightSeeingTicketDetail>(citySightSeeingTicketDetail),
                                    POneImageEventDetailMapping = pOneImageEventDetailMapping,
                                    EventHostMapping = eventHostMappingList,
                                    EventAttributes = eventAttribute.ToList(),
                                    eventRecurranceScheduleModels = recurranceScheduleModels,
                                    ASIMonument = ASIMonument,
                                    FormattedDateString = formattedDateString
                                });
                            }
                            catch (Exception e)
                            {
                                return(new TicketCategoryQueryResult
                                {
                                });
                            }
                        }
                        else
                        {
                            return(new TicketCategoryQueryResult
                            {
                                Event = eventModel,
                                EventDetail = eventDetailModel,
                                EventTicketAttribute = null,
                                TicketFeeDetail = null,
                                Venue = venueDetailModel,
                                City = cityModel,
                                EventTicketDetail = eventTicketDetailModel,
                                TicketCategory = null,
                                CurrencyType = null,
                                RASVTicketTypeMappings = RASVTicketTypeMappingsModel,
                                EventDeliveryTypeDetails = eventDeliveryTypeDetailModel,
                                EventCategory = eventModel.EventCategoryId,
                                MatchAttribute = null,
                                Team = null,
                                CitySightSeeingTicketDetail = null
                            });
                        }
                    }
                    else
                    {
                        return(new TicketCategoryQueryResult {
                        });
                    }
                }
                else
                {
                    return(new TicketCategoryQueryResult {
                    });
                }
            }
            catch (Exception e)
            {
                _logger.Log(Logging.Enums.LogCategory.Error, e);
                return(new TicketCategoryQueryResult {
                });
            }
        }
        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());
        }
        public OrderConfirmationQueryResult Handle(OrderConfirmationQuery query)
        {
            var orderConfirmation = _orderConfirmationProvider.Get(query.TransactionId, false, Contracts.Enums.Channels.Website);

            if (orderConfirmation != null)
            {
                if (orderConfirmation.orderConfirmationSubContainer[0].Event.AltId.ToString().ToUpper() == "1F0257FA-EEA6-4469-A7BC-B878A215C8A9")
                {
                    orderConfirmation.Transaction.CreatedUtc = orderConfirmation.Transaction.CreatedUtc.AddHours(10);
                }

                // Check if transaction is Tiqets One
                var tiqetsTransactions = _tiqetsTransactionRepository.GetByTransactionId(query.TransactionId);

                //for live online events
                var zoomUserModel = new ZoomUser();
                List <ZoomHostUserModel> hostUsersModel = new List <ZoomHostUserModel>();
                var liveOnlineDetailModel = _transactionRepository.GetFeelOnlineDetails(query.TransactionId).FirstOrDefault();
                if (liveOnlineDetailModel != null)
                {
                    //check if subcategory is LiveOnline
                    var eventModel = _eventRepository.Get(liveOnlineDetailModel.EventId);
                    if (eventModel.EventCategoryId == 119)
                    {
                        zoomUserModel = _zoomUserRepository.GetByTransactionId(query.TransactionId);

                        var transactionCount = _transactionRepository.GetTransactionCountByEvent(liveOnlineDetailModel.EventId);
                        if (transactionCount == 1)
                        {
                            var eventHostUsersModel = _eventHostMappingRepository.GetAllByEventId(liveOnlineDetailModel.EventId);
                            var zoomHostUserModel   = _zoomUserRepository.GetByHostUserIds(eventHostUsersModel.Select(s => s.Id));
                            foreach (var currentZoomUser in zoomHostUserModel)
                            {
                                var currentHostUsersModel = new ZoomHostUserModel();
                                var currentEventHost      = eventHostUsersModel.Where(s => s.Id == currentZoomUser.EventHostUserId).FirstOrDefault();
                                currentHostUsersModel.altId = currentZoomUser.AltId;
                                currentHostUsersModel.email = currentEventHost.Email;
                                hostUsersModel.Add(currentHostUsersModel);
                            }
                        }
                    }
                }
                return(new OrderConfirmationQueryResult
                {
                    Transaction = orderConfirmation.Transaction,
                    TransactionPaymentDetail = orderConfirmation.TransactionPaymentDetail,
                    UserCardDetail = orderConfirmation.UserCardDetail,
                    CurrencyType = orderConfirmation.CurrencyType,
                    PaymentOption = orderConfirmation.PaymentOption,
                    cardTypes = orderConfirmation.cardTypes,
                    orderConfirmationSubContainer = orderConfirmation.orderConfirmationSubContainer,
                    TicketQuantity = orderConfirmation.TicketQuantity,
                    GoodsAndServiceTax = orderConfirmation.GoodsAndServiceTax,
                    IsASI = orderConfirmation.IsASI,
                    IsTiqets = tiqetsTransactions != null ? true : false,
                    liveOnlineDetailModel = liveOnlineDetailModel,
                    ZoomUser = zoomUserModel,
                    hostUsersModel = hostUsersModel
                });
            }
            else
            {
                return(new OrderConfirmationQueryResult
                {
                    Transaction = null,
                    TransactionPaymentDetail = null,
                    UserCardDetail = null,
                    CurrencyType = null,
                    PaymentOption = null,
                    cardTypes = null,
                    orderConfirmationSubContainer = null,
                    IsASI = false,
                    IsTiqets = false
                });
            }
        }