Beispiel #1
0
        public async Task <IActionResult> GetReport(GetReportDto getReportDto)
        {
            var delta = getReportDto.EndDate - getReportDto.StartDate;
            var str   = Math.Abs(delta.TotalDays);

            if (str > 31)
            {
                return(NotFound());
            }
            else
            {
                var bin = await _planService.Report(getReportDto.StartDate, getReportDto.EndDate);

                return(File(bin, "application/octet-stream", "report.xlsx"));
            }
        }
Beispiel #2
0
        public async Task <IActionResult> GetReport(GetReportDto getReportDto)
        {
            var delta = getReportDto.EndDate - getReportDto.StartDate;
            var str   = Math.Abs(delta.TotalDays);

            if (str > 31)
            {
                var error = $"Chỉ được xuất dữ liệu báo cáo trong 30 ngày!!!<br>The report data can only be exported for 30 days!!!";
                return(BadRequest(error));
            }
            else
            {
                var bin = await _planService.Report(getReportDto.StartDate, getReportDto.EndDate);

                return(File(bin, "application/octet-stream", "report.xlsx"));
            }
        }
        public InventoryReportDto GetReport(GetReportDto report)
        {
            var result = CallRestApiWithPost <ParsedInventoryReport, GetReportDto>("/Inventory/GetReport/", report);

            return(JsonConvert.DeserializeObject <InventoryReportDto>(result.Raport));
        }
Beispiel #4
0
        public ActionResult <InventoryReportDto> GetReport([FromBody] GetReportDto report)
        {
            var results = _inventoryService.GetReport(report.InventoryId);

            return(Ok(results));
        }