Egyéb javítások

This commit is contained in:
2025-03-24 14:01:58 +01:00
parent d55dee91e9
commit 50a7eb5521
8 changed files with 85 additions and 17 deletions
+26 -5
View File
@@ -101,8 +101,33 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<List<CheckPointDTO>> UpdateAllCheckPointAsync(List<CheckPointDTO> checkPointListDTO)
{
var retVal = new List<CheckPointDTO>();
try
{
var ids = checkPointListDTO.Select(dto => dto.Id).ToList();
var checkPoints = await _dbContext.CheckPoints
.Where(cp => ids.Contains(cp.Id))
.ToListAsync();
foreach (var checkPoint in checkPoints)
{
var dto = checkPointListDTO.FirstOrDefault(d => d.Id == checkPoint.Id);
if (dto != null)
{
checkPoint.Code = dto.Code;
}
}
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<List<CheckPointDTO>>(checkPoints);
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<LocationDTO>> GetAllLocationAsync()
{
@@ -180,10 +205,6 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<List<EquipmentDTO>> GetAllEquipmentAsync()
{
var retVal = new List<EquipmentDTO>();