Ejemplo n.º 1
0
        public Task <List <ExportStory> > GetStoryAsync(StorySeriesSearch model)
        {
            var exports = _context.ExportStory
                          .AsNoTracking()
                          .ToListAsync();

            return(exports);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetReportAsync([FromQuery] StorySeriesSearch storySearch)
        {
            var export = await _exportBooksService.GetExportAsync(storySearch);

            if (export == null)
            {
                return(NotFound());
            }

            return(Ok(export));
        }
Ejemplo n.º 3
0
        public Task <List <ExportBook> > GetAsync(StorySeriesSearch model)
        {
            var exports = from storySeries in _context.StorySeries
                          where (!model.Active.HasValue || storySeries.Deleted == model.Active.Value) &&
                          (model.Filter == null ||
                           model.Filter.Length == 0 ||
                           storySeries.StoryName.ToLower().Contains(model.Filter.ToLower())
                          )
                          orderby storySeries.StoryName,
                storySeries.StoryNumber,
                storySeries.StoryType,
                storySeries.Issue,
                storySeries.IssueTitle,
                storySeries.StoryId,
                storySeries.BookId,
                storySeries.SeriesId
                select new ExportBook
            {
                StoryId  = storySeries.StoryId,
                BookId   = storySeries.BookId,
                SeriesId = storySeries.SeriesId,

                /*
                 * CodeId = storySeries.CodeId,
                 * MinSeriesOrder = storySeries.MinSeriesOrder,
                 * MaxSeriesOrder = storySeries.MaxSeriesOrder,
                 */
                Title         = storySeries.StoryName,
                OriginalTitle = storySeries.OriginalStoryName,
                StoryNumber   = storySeries.StoryNumber,
                ExtraInfo     = storySeries.ExtraInfo,
                StoryType     = storySeries.StoryType,
                BookType      = storySeries.BookType,
                Character     = storySeries.CharacterName,
                StoryCode     = storySeries.StoryCode,
                Artist        = storySeries.ArtistName,
                /*ArtistType = storySeries.ArtistType is null ? ArtistType.translator : storySeries.ArtistType,*/
                Issue        = storySeries.Issue,
                IssueTitle   = storySeries.IssueTitle,
                Language     = storySeries.Language,
                Series       = storySeries.SeriesName,
                Publisher    = storySeries.PublisherName,
                Year         = storySeries.Year,
                PurchaseDate = storySeries.PurchaseDate,
                Notes        = storySeries.ExtraInfo,
                Deleted      = storySeries.Deleted
            };

            return(exports
                   .ToListAsync());
        }
Ejemplo n.º 4
0
        public async Task <ICollection <ExportBooksOutputModel> > GetAsync(StorySeriesSearch searchModel)
        {
            var exportBooks = await _exportBooksRepository.GetAsync(searchModel);

            try
            {
                var exportBooksOutput = _mapper.Map <ICollection <ExportBooksOutputModel> >(exportBooks);

                return(exportBooksOutput);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
        public Task <List <ExportBook> > GetAsync(StorySeriesSearch model)
        {
            var exports = _context.ExportBooks
                          .Where(s => (!model.Active.HasValue || s.Deleted == model.Active.Value) &&
                                 (model.Filter == null || model.Filter.Length == 0 || s.Title.ToLower().Contains(model.Filter.ToLower())))
                          .OrderBy(e => e.Title)
                          .ThenBy(e => e.StoryNumber)
                          .ThenBy(e => e.StoryType)
                          .ThenBy(e => e.Issue)
                          .ThenBy(e => e.IssueTitle)
                          .ThenBy(e => e.StoryId)
                          .ThenBy(e => e.BookId)
                          .ThenBy(e => e.SeriesId)
                          .AsNoTracking()
                          .ToListAsync();

            return(exports);
        }
Ejemplo n.º 6
0
 public async Task <string> GetExportAsync(StorySeriesSearch searchModel)
 {
     return(Reports.Reports.DataExport(await _exportBooksRepository.GetAsync(searchModel)));
 }
Ejemplo n.º 7
0
        public async Task <IActionResult> GetAsync([FromQuery] StorySeriesSearch storySearch)
        {
            var result = await _exportBooksService.GetAsync(storySearch);

            return(Ok(result));
        }