Jó kis javítás, fejlesztés TESZT-hez
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
@@ -229,5 +230,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<NumberGeneratorTemplateDTO>> GetNumbergenerators()
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/Sync/GetAllNumbergenerators";
|
||||
var retVal = new List<NumberGeneratorTemplateDTO>();
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<NumberGeneratorTemplateDTO>>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,34 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<ApiResponseDTO<CheckListTemplateHeaderDTO>> UpdateCheckListTemplateHeader(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO) => throw new NotImplementedException();
|
||||
public async Task<ApiResponseDTO<CheckListTemplateHeaderDTO>> UpdateCheckListTemplateHeader(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/CheckList/UpdateCheckListTemplateHeader";
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, checkListTemplateHeaderDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<CheckListTemplateHeaderDTO>>(jsonString);
|
||||
|
||||
return response ?? new ApiResponseDTO<CheckListTemplateHeaderDTO>
|
||||
{
|
||||
IsSuccess = false,
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Hiba visszaadása
|
||||
return new ApiResponseDTO<CheckListTemplateHeaderDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
{
|
||||
@@ -17,5 +18,7 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<LocationDTO> GetLocation(int id);
|
||||
Task<List<LocationDTO>> GetAllLocations();
|
||||
Task<ApiResponseDTO<LocationDTO>> UpdateLocation(LocationDTO LocationDTO);
|
||||
|
||||
Task<List<NumberGeneratorTemplateDTO>> GetNumbergenerators();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user