Exemplo n.º 1
0
 public EventImageQueryResult Handle(EventImageQuery query)
 {
     try
     {
         var eventImageQueryResult = new EventImageQueryResult();
         var eventImageModel       = new FIL.Contracts.Models.CreateEventV1.EventImageModel();
         var currentEvent          = _eventRepository.Get(query.EventId);
         var eventGallaryImage     = _eventGalleryImageRepository.GetByEventId(query.EventId).FirstOrDefault();
         eventImageModel.IsBannerImage         = true;
         eventImageModel.IsHotTicketImage      = true;
         eventImageModel.IsPortraitImage       = eventGallaryImage != null ? eventGallaryImage.IsPortraitImage != null ? eventGallaryImage.IsPortraitImage : false : false;
         eventImageModel.IsVideoUploaded       = eventGallaryImage != null ? eventGallaryImage.IsVideoUploaded != null ? eventGallaryImage.IsVideoUploaded : false : false;
         eventImageModel.EventAltId            = currentEvent.AltId;
         eventImageModel.EventId               = currentEvent.Id;
         eventImageQueryResult.EventImageModel = eventImageModel;
         eventImageQueryResult.Success         = true;
         eventImageQueryResult.IsDraft         = false;
         eventImageQueryResult.IsValidLink     = true;
         return(eventImageQueryResult);
     }
     catch (Exception e)
     {
         return(new EventImageQueryResult {
         });
     }
 }
Exemplo n.º 2
0
        public WebEventLearnPageQueryResults Handle(EventLearnPageQuery query)
        {
            var eventDataModel = _eventRepository.GetByAltId(query.EventAltId);
            var eventModel     = AutoMapper.Mapper.Map <Contracts.Models.Event>(eventDataModel);

            if (eventModel != null)
            {
                var eventDetailDataModel = _eventDetailRepository.GetAllByEventId(eventDataModel.Id);
                var eventDetailModel     = AutoMapper.Mapper.Map <List <Contracts.Models.EventDetail> >(eventDetailDataModel);

                var venueDataModel = _venueRepository.GetByVenueIds(eventDetailDataModel.Select(s => s.VenueId).Distinct());
                var venueModel     = AutoMapper.Mapper.Map <List <Contracts.Models.Venue> >(venueDataModel);

                var cityDataModel = _cityRepository.GetByCityIds(venueDataModel.Select(s => s.CityId));
                var cityModel     = AutoMapper.Mapper.Map <List <Contracts.Models.City> >(cityDataModel);

                var stateDataModel = _stateRepository.GetByStateIds(cityDataModel.Select(s => s.StateId));
                var stateModel     = AutoMapper.Mapper.Map <List <Contracts.Models.State> >(stateDataModel);

                var countryDataModel = _countryRepository.GetByCountryIds(stateDataModel.Select(s => s.CountryId));
                var countryModel     = AutoMapper.Mapper.Map <List <Contracts.Models.Country> >(countryDataModel);

                var eventGallaryDataModel = _eventGalleryImageRepository.GetByEventId(eventModel.Id);
                var galleryDataModel      = AutoMapper.Mapper.Map <List <Contracts.Models.EventGalleryImage> >(eventGallaryDataModel);

                var ratingDataModel = _ratingRepository.GetByEventId(eventDataModel.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 eventCategoryDataModel = _eventCategoryRepository.Get(eventModel.EventCategoryId);
                var eventCategoryModel     = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(eventCategoryDataModel);

                return(new WebEventLearnPageQueryResults
                {
                    EventType = (EventType)eventModel.EventTypeId != 0 ? (EventType)eventModel.EventTypeId : EventType.Regular,
                    EventCategory = eventCategoryModel,
                    Event = eventModel,
                    EventDetail = eventDetailModel,
                    Venue = venueModel,
                    City = cityModel,
                    Rating = ratingModel,
                    User = userModel,
                    State = stateModel,
                    Country = countryModel,
                    EventGalleryImage = galleryDataModel
                });
            }
            else
            {
                return(new WebEventLearnPageQueryResults
                {
                });
            }
        }
Exemplo n.º 3
0
        private string GetImagePath(long id)
        {
            var img = _eventGalleryImageRepository.GetByEventId(Convert.ToInt32(id));

            if (img != null && img.Count() > 0)
            {
                return(img.FirstOrDefault().AltId.ToString());
            }
            return("");
        }
Exemplo n.º 4
0
        public EventLearnPageQueryResults GetEventResult(Event eventDataModel)
        {
            var eventModel = AutoMapper.Mapper.Map <Contracts.Models.Event>(eventDataModel);

            var eventDetailDataModel = _eventDetailRepository.GetByEventId(eventDataModel.Id);
            var eventDetailModel     = AutoMapper.Mapper.Map <Contracts.Models.EventDetail>(eventDetailDataModel);

            if (eventDetailModel == null)
            {
                return(new EventLearnPageQueryResults {
                });
            }
            var venueDataModel = _venueRepository.Get(eventDetailDataModel.VenueId);
            var venueModel     = AutoMapper.Mapper.Map <Contracts.Models.Venue>(venueDataModel);

            var cityDataModel = _cityRepository.Get(venueDataModel.CityId);
            var cityModel     = AutoMapper.Mapper.Map <Contracts.Models.City>(cityDataModel);

            var stateDataModel = _stateRepository.Get(cityDataModel.StateId);
            var stateModel     = AutoMapper.Mapper.Map <Contracts.Models.State>(stateDataModel);

            var countryDataModel = _countryRepository.Get(stateDataModel.CountryId);
            var countryModel     = AutoMapper.Mapper.Map <Contracts.Models.Country>(countryDataModel);

            var eventGallaryDataModel = _eventGalleryImageRepository.GetByEventId(eventModel.Id);
            var galleryDataModel      = AutoMapper.Mapper.Map <List <Contracts.Models.EventGalleryImage> >(eventGallaryDataModel);

            //if (eventModel.EventSourceId == EventSource.ExperienceOz)
            //{
            var eventCategoryIds = new HashSet <int>(_eventCategoryMappingRepository.GetByEventId((int)eventModel.Id)
                                                     .Select(ce => ce.EventCategoryId));

            eventModel.EventCategoryId = (Int16)eventCategoryIds.FirstOrDefault();
            //}

            var eventCategoryDataModel = _eventCategoryRepository.Get(eventModel.EventCategoryId);
            var eventCategoryModel     = AutoMapper.Mapper.Map <Contracts.Models.EventCategory>(eventCategoryDataModel);

            return(new EventLearnPageQueryResults
            {
                EventType = (EventType)eventModel.EventTypeId,
                EventCategory = eventCategoryModel,
                Event = eventModel,
                EventDetail = eventDetailModel,
                Venue = venueModel,
                City = cityModel,
                State = stateModel,
                Country = countryModel,
                EventGalleryImage = galleryDataModel
            });
        }
Exemplo n.º 5
0
 protected override async Task <ICommandResult> Handle(EventImageCommand command)
 {
     try
     {
         var eventGalleryList  = _eventGalleryImageRepository.GetByEventId(command.EventImageModel.EventId).FirstOrDefault();
         var savedGalleryImage = SaveEventGallery(command, eventGalleryList);
         command.EventImageModel.Id = savedGalleryImage.Id;
         var eventStepDetail = _stepProvider.SaveEventStepDetails(command.EventImageModel.EventId, command.CurrentStep, true, command.ModifiedBy);
         return(new EventImageCommandResult
         {
             EventImageModel = command.EventImageModel,
             CompletedStep = eventStepDetail.CompletedStep,
             CurrentStep = eventStepDetail.CurrentStep,
             Success = true
         });
     }
     catch (Exception e)
     {
         _logger.Log(LogCategory.Error, new Exception("Fail to update the Event Image", e));
         return(new EventImageCommandResult {
         });
     }
 }
Exemplo n.º 6
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);
        }