POST hogy tudjunk menteni is.

This commit is contained in:
2025-03-13 14:23:19 +01:00
parent a301a2a168
commit d2106514ba
4 changed files with 69 additions and 9 deletions
@@ -7,9 +7,10 @@ namespace WorkFlowCheck.BL.Services.Interfaces
{
Task<List<CheckPointDTO>> GetAllCheckPointAsync();
Task<CheckPointDTO> GetCheckPointAsync(int id);
Task<CheckPointDTO> UpdateCheckPointAsync(CheckPointDTO checkPointDTO);
Task<List<LocationDTO>> GetAllLocationAsync();
Task<List<EquipmentDTO>> GetAllEquipmentAsync();
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync();
}
}
@@ -66,6 +66,30 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<CheckPointDTO> UpdateCheckPointAsync(CheckPointDTO checkPointDTO)
{
var retVal = new CheckPointDTO();
try
{
var res = await _dbContext.CheckPoints.Where(w => w.Id == checkPointDTO.Id).FirstOrDefaultAsync();
if (res != null)
{
res.ShortName = checkPointDTO.ShortName;
res.Code = checkPointDTO.Code;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<CheckPointDTO>(res);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<LocationDTO>> GetAllLocationAsync()
{
var retVal = new List<LocationDTO>();