You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Digitalisation_EPA_Serveur/EPAServeur/Services/EpDetailsService.cs

79 lines
1.9 KiB

using EPAServeur.Context;
using EPAServeur.Exceptions;
using EPAServeur.IServices;
using EPAServeur.Models.EP;
using IO.Swagger.ApiCollaborateur;
using IO.Swagger.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EPAServeur.Services
{
public class EpDetailsService : IEpDetailsService
{
private EpContext context;
private ITransformDTO transformDTO;
private ICollaborateurService collaborateurService;
public EpDetailsService(EpContext context, ITransformDTO transformDTO, ICollaborateurService collaborateurService)
{
this.context = context;
this.transformDTO = transformDTO;
this.collaborateurService = collaborateurService;
}
public async Task<EpDTO> GetEp(long id)
{
Ep ep = await context.Ep.FindAsync(id);
if (ep == null)
throw new EpNotFoundException();
List<Guid?> guids = new List<Guid?>();
guids.Add(ep.IdCollaborateur);
if (ep.IdReferent.HasValue)
guids.Add(ep.IdCollaborateur);
IEnumerable<CollaborateurDTO> collaborateurDTOs = await collaborateurService.GetCollaborateurDTOsAsync(guids) ;
EpDTO epDTO = transformDTO.EpToEpDetails(ep, collaborateurDTOs);
return epDTO;
}
public void RappelSignature(long idEp)
{
throw new NotImplementedException();
}
public Task<EpDTO> SaisirEPCollaborateur(Guid? idCollaborateur)
{
throw new NotImplementedException();
}
public Task<EpDTO> SaisirEPReferent(long idEp)
{
throw new NotImplementedException();
}
public void SupprimerDonneesEPCollaborateur(Guid? idCollaborateur)
{
throw new NotImplementedException();
}
public void SupprimerEP(long idEp)
{
throw new NotImplementedException();
}
public Task<EpDTO> UpdateEP(long idEp, EpDTO ep)
{
throw new NotImplementedException();
}
public Task<EpDTO> UpdateSaisie(long idEp, EpDTO ep)
{
throw new NotImplementedException();
}
}
}