Пример #1
0
        public IActionResult GetSalesBranchReportLastMonth()
        {
            // Set the filter to "LastMonth"
            var filter = new SalesBranchReportFilterDto();

            filter.SetLastMonth();

            // Return to response
            var listToReturn = GetSalesBranchReport <SalesBranchReportDto>(filter);

            return(Ok(listToReturn));
        }
Пример #2
0
        public IActionResult GetSalesBranchReportDateRange([FromQuery] DateTime startDateTime,
                                                           [FromQuery] DateTime endDateTime)
        {
            // Validate user inpute
            if (startDateTime == null || endDateTime == null)
            {
                return(BadRequest());
            }

            // Set the filter to "DateRange"
            var filter = new SalesBranchReportFilterDto
            {
                StartDateTime = startDateTime,
                EndDateTime   = endDateTime
            };

            // Return to response
            var listToReturn = GetSalesBranchReport <SalesBranchReportDto>(filter);

            return(Ok(listToReturn));
        }