示例#1
0
        public async Task <SearchResult <AlbumViewModel> > Search(string tenantId, string eventId, string languageId, int page, int pageSize)
        {
            var listEventAlbum = await _eventAlbumRepository.Search(tenantId, eventId, null, page, pageSize, out var totalRows);

            if (listEventAlbum == null || listEventAlbum.Count == 0)
            {
                return new SearchResult <AlbumViewModel>
                       {
                           Items = null,
                       }
            }
            ;

            var apiUrls = _configuration.GetApiUrl();

            return(await new HttpClientService()
                   .PostAsync <SearchResult <AlbumViewModel> >($"{apiUrls.WebsiteApiUrl}/albums/client/{tenantId}/{languageId}", listEventAlbum));
        }
示例#2
0
        public async Task <ActionResultResponse <EventShowClientViewModel> > GetEventDetailShowClient(string tenantId, string languageId, string seoLink)
        {
            var eventInfo = await _eventRepository.GetDetailClient(tenantId, languageId, seoLink);

            if (eventInfo == null)
            {
                return new ActionResultResponse <EventShowClientViewModel>
                       {
                           Code = -1,
                       }
            }
            ;

            var listEventDay = await _eventDayRepository.Search(languageId, eventInfo.Id, true, 1, int.MaxValue, out int totalRows);

            var listInvitations = await _registerRepository.SearchClient(eventInfo.Id, languageId, null);

            var albumIds = await _eventAlbumRepository.Search(tenantId, eventInfo.Id, true, 1, short.MaxValue, out var totalAlbumRows);

            var apiUrls = _configuration.GetApiUrl();
            var albums  = await new HttpClientService()
                          .PostAsync <SearchResult <AlbumWithItemViewModel> >($"{apiUrls.WebsiteApiUrl}/albums/{tenantId}/album-width-item/{languageId}", albumIds);

            var eventShowClient = new EventShowClientViewModel
            {
                EventInfo   = eventInfo,
                EventDays   = listEventDay,
                Invitations = listInvitations,
                Albums      = albums?.Items,
            };

            return(new ActionResultResponse <EventShowClientViewModel>
            {
                Data = eventShowClient
            });
        }