ISyncService bővítése
This commit is contained in:
@@ -5,7 +5,10 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
{
|
||||
public interface ISyncService
|
||||
{
|
||||
Task<CheckPointListDTO> GetAllCheckPointAsync();
|
||||
Task<List<CheckPointDTO>> GetAllCheckPointAsync();
|
||||
Task<List<LocationDTO>> GetAllLocationAsync();
|
||||
Task<List<EquipmentDTO>> GetAllEquipmentAsync();
|
||||
|
||||
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Serilog;
|
||||
using System.Collections.Generic;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.DL;
|
||||
@@ -20,16 +21,54 @@ namespace WorkFlowCheck.BL.Services
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<CheckPointListDTO> GetAllCheckPointAsync()
|
||||
public async Task<List<CheckPointDTO>> GetAllCheckPointAsync()
|
||||
{
|
||||
var retVal = new CheckPointListDTO();
|
||||
var retVal = new List<CheckPointDTO>();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckPoints.ToListAsync();
|
||||
if (res != null)
|
||||
{
|
||||
retVal.CheckPointList = _mapper.Map<List<CheckPointDTO>>(res);
|
||||
retVal = _mapper.Map<List<CheckPointDTO>>(res);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<List<LocationDTO>> GetAllLocationAsync()
|
||||
{
|
||||
var retVal = new List<LocationDTO>();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.Locations.ToListAsync();
|
||||
if (res != null)
|
||||
{
|
||||
retVal = _mapper.Map<List<LocationDTO>>(res);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<List<EquipmentDTO>> GetAllEquipmentAsync()
|
||||
{
|
||||
var retVal = new List<EquipmentDTO>();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.Equipments.ToListAsync();
|
||||
if (res != null)
|
||||
{
|
||||
retVal = _mapper.Map<List<EquipmentDTO>>(res);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -60,24 +99,6 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
return retVal;
|
||||
}
|
||||
public async Task<CheckPointListDTO> GetAllLocation()
|
||||
{
|
||||
var retVal = new CheckPointListDTO();
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckPoints.ToListAsync();
|
||||
if (res != null)
|
||||
{
|
||||
retVal.CheckPointList = _mapper.Map<List<CheckPointDTO>>(res);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user