Пример #1
0
        public async Task <List <BookingReportDto> > GetBookingReport(BookingReportQueryDto queryDto)
        {
            if (queryDto.StartDate == null)
            {
                queryDto.StartDate = Clock.Now.Date;
            }
            if (queryDto.EndDate == null)
            {
                queryDto.EndDate = Clock.Now;
            }

            var reports = await _unitOfWork
                          .GetDbContext <ApplicationDbContext>()
                          .Database.ExecuteSqlToObject <BookingReportDto>(@"Exec Sp_BookingReport",
                                                                          queryDto.TerminalId, queryDto.Keyword, queryDto.BookingType, queryDto.BookingStatus, queryDto.CreatedBy, queryDto.ReferenceCode,
                                                                          queryDto.StartDate, queryDto.EndDate, queryDto.PageIndex, queryDto.PageSize);

            return(reports.ToList());
        }
Пример #2
0
 public async Task <IServiceResponse <List <BookingReportDto> > > BookingReports(BookingReportQueryDto queryDto)
 {
     return(await HandleApiOperationAsync(async() =>
     {
         var reports = await _bookingReportService.GetBookingReport(queryDto);
         return new ServiceResponse <List <BookingReportDto> >
         {
             Object = reports
         };
     }));
 }