PDF készítés DevExpressel.

This commit is contained in:
2025-04-02 13:01:49 +02:00
parent 12bf69aadd
commit 90637b3848
9 changed files with 114 additions and 109 deletions
@@ -15,7 +15,7 @@ namespace WorkFlowCheck.Web.Services
public CheckListService(HttpClient httpClient, IConfiguration configuration, IHttpContextAccessor httpContextAccessor) : base(httpClient, configuration, httpContextAccessor)
{
}
public async Task<List<CheckListHeaderDTO>> GetAllCheckListHeaderAsync()
{
var endpoint = $"{_httpClient.BaseAddress}api/CheckList/GetAllCheckListHeaders";
@@ -60,6 +60,27 @@ namespace WorkFlowCheck.Web.Services
}
public async Task<ApiResponseDTO<CheckListHeaderDTO>> UpdateCheckListHeader(CheckListHeaderDTO checkListHeaderDTO) => throw new NotImplementedException();
public async Task<ApiResponseDTO<byte[]>> CreatePDF(int id)
{
var retVal = new ApiResponseDTO<byte[]>();
var endpoint = $"{_httpClient.BaseAddress}api/CheckList/CreatePDF/{id}";
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<byte[]>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateHeaderAsync()
{
@@ -250,5 +271,5 @@ namespace WorkFlowCheck.Web.Services
.GetCustomAttribute<DisplayAttribute>()?.Name ?? enumValue.ToString();
}
}
}