public MyShowThumbnail<IMyShowArt> GetAnyMyShowArtForUser(Guid userId)
        {
            var myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
            var artService = new ArtService(Ioc.GetInstance<IArtRepository>());
            var photoService = new PhotoService(Ioc.GetInstance<IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowArts = GetAllMyShowArt().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowArt in myShowArts)
            {
                var art = artService.GetArt(myShowArt.ArtId);
                var photo = photoService.GetPhotoThumbnail(art.PhotoId);
                if (photo.Thumbnail)
                    return new MyShowThumbnail<IMyShowArt>(myShowArt, photo);
            }
            
            return null;
        }
        public MyShowThumbnail<IMyShowTicketStub> GetAnyMyShowTicketStubForUser(Guid userId)
        {
            var myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
            var ticketStubService = new TicketStubService(Ioc.GetInstance<ITicketStubRepository>());
            var photoService = new PhotoService(Ioc.GetInstance<IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowTicketStubs = GetAllMyShowTicketStubs().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowTicketStub in myShowTicketStubs)
            {
                var ticketStub = ticketStubService.GetTicketStub(myShowTicketStub.TicketStubId);
                var photo = photoService.GetPhotoThumbnail(ticketStub.PhotoId);
                if (photo.Thumbnail)
                    return new MyShowThumbnail<IMyShowTicketStub>(myShowTicketStub, photo);
            }

            return null;
        }
        public MyShowThumbnail<IMyShowPoster> GetAnyMyShowPosterForUser(Guid userId)
        {
            var myShowService = new MyShowService(Ioc.GetInstance<IMyShowRepository>());
            var posterService = new PosterService(Ioc.GetInstance<IPosterRepository>());
            var photoService = new PhotoService(Ioc.GetInstance<IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowPosters = GetAllMyShowPosters().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowPoster in myShowPosters)
            {
                var poster = posterService.GetPoster(myShowPoster.PosterId);
                var photo = photoService.GetPhotoThumbnail(poster.PhotoId);
                if (photo.Thumbnail)
                    return new MyShowThumbnail<IMyShowPoster>(myShowPoster, photo);
            }

            return null;
        }
        public MyShowThumbnail <IMyShowArt> GetAnyMyShowArtForUser(Guid userId)
        {
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            var artService    = new ArtService(Ioc.GetInstance <IArtRepository>());
            var photoService  = new PhotoService(Ioc.GetInstance <IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowArts = GetAllMyShowArt().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowArt in myShowArts)
            {
                var art   = artService.GetArt(myShowArt.ArtId);
                var photo = photoService.GetPhotoThumbnail(art.PhotoId);
                if (photo.Thumbnail)
                {
                    return(new MyShowThumbnail <IMyShowArt>(myShowArt, photo));
                }
            }

            return(null);
        }
Exemple #5
0
        public MyShowThumbnail <IMyShowTicketStub> GetAnyMyShowTicketStubForUser(Guid userId)
        {
            var myShowService     = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            var ticketStubService = new TicketStubService(Ioc.GetInstance <ITicketStubRepository>());
            var photoService      = new PhotoService(Ioc.GetInstance <IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowTicketStubs = GetAllMyShowTicketStubs().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowTicketStub in myShowTicketStubs)
            {
                var ticketStub = ticketStubService.GetTicketStub(myShowTicketStub.TicketStubId);
                var photo      = photoService.GetPhotoThumbnail(ticketStub.PhotoId);
                if (photo.Thumbnail)
                {
                    return(new MyShowThumbnail <IMyShowTicketStub>(myShowTicketStub, photo));
                }
            }

            return(null);
        }
Exemple #6
0
        public MyShowThumbnail <IMyShowPoster> GetAnyMyShowPosterForUser(Guid userId)
        {
            var myShowService = new MyShowService(Ioc.GetInstance <IMyShowRepository>());
            var posterService = new PosterService(Ioc.GetInstance <IPosterRepository>());
            var photoService  = new PhotoService(Ioc.GetInstance <IPhotoRepository>());

            var myShows = myShowService.GetMyShowsForUser(userId);

            var myShowPosters = GetAllMyShowPosters().Where(x => myShows.Any(y => y.MyShowId == x.MyShowId)).OrderByDescending(z => z.CreatedDate);

            foreach (var myShowPoster in myShowPosters)
            {
                var poster = posterService.GetPoster(myShowPoster.PosterId);
                var photo  = photoService.GetPhotoThumbnail(poster.PhotoId);
                if (photo.Thumbnail)
                {
                    return(new MyShowThumbnail <IMyShowPoster>(myShowPoster, photo));
                }
            }

            return(null);
        }