Egyéb javítások
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user