public async Task <FileResult> GetServiceCodeRefundItemsReportFile([FromQuery] DateTime?from, [FromQuery] DateTime?to, [FromQuery] int servicecode) { ServiceCodeItemsFilter filter = new ServiceCodeItemsFilter() { From = from, To = to, ServiceCode = servicecode, }; if (filter.To.HasValue) { filter.To = filter.To.Value.AddDays(1); } var result = await _serviceCodeService.GetServiceCodeRefundItemsAsync(filter); var data = _serviceCodeRefundItemCSVExportService.ExportToCsv(result.Items); var contentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = String.Format(FileConstants.REFUNDS_REPORT, DateTime.Now) }; Response.Headers.Add("Content-Disposition", contentDisposition.ToString()); return(File(data, "text/csv")); }
public async Task <Result <PagedList <ServiceCodeReshipItem> > > GetServiceCodeReshipItems([FromBody] ServiceCodeItemsFilter filter) { if (filter.To.HasValue) { filter.To = filter.To.Value.AddDays(1); } var toReturn = await _serviceCodeService.GetServiceCodeReshipItemsAsync(filter); return(toReturn); }