|
|
|
|
using EPAServeur.Context;
|
|
|
|
|
using EPAServeur.IServices;
|
|
|
|
|
using IO.Swagger.ApiCollaborateur;
|
|
|
|
|
using IO.Swagger.DTO;
|
|
|
|
|
using IO.Swagger.ModelCollaborateur;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace EPAServeur.Services
|
|
|
|
|
{
|
|
|
|
|
public class CollaborateurService : ICollaborateurService
|
|
|
|
|
{
|
|
|
|
|
private readonly ICollaborateurApi collaborateurApi;
|
|
|
|
|
|
|
|
|
|
public CollaborateurService(ICollaborateurApi _collaborateurApi)
|
|
|
|
|
{
|
|
|
|
|
collaborateurApi = _collaborateurApi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CollaborateurDTO GetCollaborateurById(Guid? id)
|
|
|
|
|
{
|
|
|
|
|
Collaborateur collaborateur = collaborateurApi.ChercherCollabId(id);
|
|
|
|
|
if (collaborateur == null)
|
|
|
|
|
return null;
|
|
|
|
|
CollaborateurDTO collaborateurDTO = new CollaborateurDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Id,
|
|
|
|
|
Prenom = collaborateur.Prenom,
|
|
|
|
|
Nom = collaborateur.Nom,
|
|
|
|
|
MailApside = collaborateur.MailApside,
|
|
|
|
|
DateArrivee = collaborateur.DateArrivee,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
collaborateurDTO.BusinessUnit = new BusinessUnitDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.BusinessUnit.Id,
|
|
|
|
|
Nom = collaborateur.BusinessUnit.Nom,
|
|
|
|
|
Agence = new AgenceDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.BusinessUnit.Agence.Id,
|
|
|
|
|
Nom = collaborateur.BusinessUnit.Agence.Nom
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
collaborateurDTO.Referent = new ReferentDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Referent.Id,
|
|
|
|
|
Prenom = collaborateur.Referent.Prenom,
|
|
|
|
|
Nom = collaborateur.Referent.Nom,
|
|
|
|
|
MailApside = collaborateur.Referent.MailApside
|
|
|
|
|
};
|
|
|
|
|
return collaborateurDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CollaborateurDTO GetCollaborateurByMail(string mail)
|
|
|
|
|
{
|
|
|
|
|
Collaborateur collaborateur = collaborateurApi.ChercherCollabMail(mail);
|
|
|
|
|
CollaborateurDTO collaborateurDTO = new CollaborateurDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Id,
|
|
|
|
|
Prenom = collaborateur.Prenom,
|
|
|
|
|
Nom = collaborateur.Nom,
|
|
|
|
|
MailApside = collaborateur.MailApside,
|
|
|
|
|
DateArrivee = collaborateur.DateArrivee
|
|
|
|
|
};
|
|
|
|
|
collaborateurDTO.Referent = new ReferentDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Referent.Id,
|
|
|
|
|
Prenom = collaborateur.Referent.Prenom,
|
|
|
|
|
Nom = collaborateur.Referent.Nom,
|
|
|
|
|
MailApside = collaborateur.Referent.MailApside
|
|
|
|
|
};
|
|
|
|
|
return collaborateurDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<CollaborateurDTO> GetCollaborateurs()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<CollaborateurDTO> GetCollaborateursByReferent(Guid? idReferent)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
Collaborateur collaborateur = collaborateurApi.ChercherCollabRef(idReferent);
|
|
|
|
|
CollaborateurDTO collaborateurDTO = new CollaborateurDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Id,
|
|
|
|
|
Prenom = collaborateur.Prenom,
|
|
|
|
|
Nom = collaborateur.Nom,
|
|
|
|
|
MailApside = collaborateur.MailApside,
|
|
|
|
|
DateArrivee = collaborateur.DateArrivee
|
|
|
|
|
};
|
|
|
|
|
collaborateurDTO.Referent = new ReferentDTO()
|
|
|
|
|
{
|
|
|
|
|
Id = collaborateur.Referent.Id,
|
|
|
|
|
Prenom = collaborateur.Referent.Prenom,
|
|
|
|
|
Nom = collaborateur.Referent.Nom,
|
|
|
|
|
MailApside = collaborateur.Referent.MailApside
|
|
|
|
|
};
|
|
|
|
|
return collaborateurDTO;
|
|
|
|
|
*/
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProfilDTO GetProfilByMail(string mail)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|