This commit is contained in:
2023-01-23 18:48:43 -07:00
parent 56ec81e080
commit 662863a11e
15 changed files with 247 additions and 52 deletions

View File

@ -66,6 +66,23 @@ public class ToolTypesController : Controller, IToolTypesController<IActionResul
return Content(json);
}
[HttpGet]
[Route("{toolTypeId}/export")]
public IActionResult GetExportData(int toolTypeId, [FromQuery] DateTime? datebegin, [FromQuery] DateTime? dateend)
{
Shared.DataModels.Result<DataTable> r = _ToolTypesRepository.GetExportData(_MetrologyRepo, toolTypeId, datebegin, dateend);
string json = JsonConvert.SerializeObject(r);
return Content(json);
}
[HttpGet]
[Route("{toolTypeId}/csv")]
public IActionResult GetCSVExport(int toolTypeId, [FromQuery] DateTime? datebegin, [FromQuery] DateTime? dateend, [FromQuery] string? filename)
{
byte[] r = _ToolTypesRepository.GetCSVExport(_MetrologyRepo, toolTypeId, datebegin, dateend);
return File(r, "application/octet-stream", filename);
}
[HttpGet]
[Route("{toolTypeId}/{tabletype}/files/{attachmentId}/{filename}")]
public IActionResult GetAttachment(int toolTypeId, string tabletype, string attachmentId, string filename)