Exemplo n.º 1
0
        private void SaveEventAmentity(SaveEventCommand command, long id)
        {
            var entries = _eventAmenityRepository.GetByEventId(id);

            foreach (var entry in entries)
            {
                _eventAmenityRepository.Delete(entry);
            }
            if (command.AmenityIds != "")
            {
                var amenities = command.AmenityIds.Split(',');
                foreach (var amenity in amenities)
                {
                    var eventAmenity = new EventAmenity
                    {
                        AmenityId   = Convert.ToInt32(amenity),
                        Description = command.Description ?? "",
                        EventId     = id,
                        IsEnabled   = command.IsEnabled,
                        UpdatedBy   = command.ModifiedBy,
                        UpdatedUtc  = DateTime.UtcNow,
                        CreatedBy   = command.ModifiedBy,
                        CreatedUtc  = DateTime.UtcNow,
                        ModifiedBy  = command.ModifiedBy,
                        Id          = 0
                    };
                    _eventAmenityRepository.Save(eventAmenity);
                }
            }
        }
Exemplo n.º 2
0
        protected override async Task Handle(EventAmenityCommand command)
        {
            var entries = _eventAmenityRepository.GetByEventId(command.EventId);

            foreach (var entry in entries)
            {
                _eventAmenityRepository.Delete(entry);
            }
            var eventAmenityresult = _eventAmenityRepository.Get(command.Id);
            var eventAmenity       = new EventAmenity
            {
                AmenityId   = command.AmenityId,
                Description = command.Description,
                EventId     = command.EventId,
                IsEnabled   = command.IsEnabled,
                UpdatedBy   = command.ModifiedBy,
                UpdatedUtc  = DateTime.UtcNow,
                CreatedBy   = command.ModifiedBy,
                CreatedUtc  = DateTime.UtcNow,
                ModifiedBy  = command.ModifiedBy,
                Id          = command.Id
            };

            _eventAmenityRepository.Save(eventAmenity);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        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());
        }