* Further improvements for Marelli PackingList
This commit is contained in:
@@ -63,20 +63,34 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CreateWzRowsMeyleAsync(IEnumerable<WzRowMeyleDto> wzRowMeyles)
|
||||
public async Task CreateWzRowsMeyleAsync(IEnumerable<WzRowMeyleDto> wzRowsMeyle)
|
||||
{
|
||||
if (wzRowMeyles == null || !wzRowMeyles.Any())
|
||||
if (wzRowsMeyle == null || !wzRowsMeyle.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to create.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzRowMeyle", wzRowMeyles);
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzRowMeyle", wzRowsMeyle);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
var errorContent = await response.Content.ReadAsStringAsync();
|
||||
throw new HttpRequestException($"Failed to create WzRowMeyle: {response.StatusCode}, Content: {errorContent}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CreateWzRowsMarelliAsync(IEnumerable<WzRowMarelliDto> wzRowsMarelli)
|
||||
{
|
||||
if (wzRowsMarelli == null || !wzRowsMarelli.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to create.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzRowMarelli", wzRowsMarelli);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
var errorContent = await response.Content.ReadAsStringAsync();
|
||||
throw new HttpRequestException($"Failed to create WzRowMarelli: {response.StatusCode}, Content: {errorContent}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<CustomerOrderDto> GetCustomerOrder(string customerOrderNumber)
|
||||
@@ -95,12 +109,19 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
return await response.Content.ReadFromJsonAsync<ItemCustDto>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzRowMeyleDto>> GetWzRowsByWzHeaderId(Guid wzHeaderId)
|
||||
public async Task<IEnumerable<WzRowMeyleDto>> GetWzRowsMeyleByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzRowMeyle/by-wz-header-id?wzHeaderId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzRowMeyleDto>>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzRowMarelliDto>> GetWzRowsMarelliByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzRowMarelli/by-wz-header-id?wzHeaderId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzRowMarelliDto>>();
|
||||
}
|
||||
|
||||
public async Task<IDictionary<string, List<TransactionModel>>> GetTransactionsModels()
|
||||
{
|
||||
@@ -124,6 +145,17 @@ public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
public async Task UpdateWzRowsMarelliAsync(IEnumerable<WzRowMarelliDto?> wzRowsMarelli)
|
||||
{
|
||||
if (wzRowsMarelli == null || !wzRowsMarelli.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to update.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PutAsJsonAsync("api/WzRowMarelli", wzRowsMarelli);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
public async Task GenerateXlsForMeyleAsync(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/ExcelGenerator/generate-meyle?packListId={wzHeaderId}");
|
||||
|
||||
Reference in New Issue
Block a user