|
|
|
@ -39,14 +39,14 @@ namespace EPAServeur.Services |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<CollaborateurDTO> GetCollaborateurs(bool? asc, int? numPage, int? parPage, List<string> fonctions, int? idAgence, int? idBU, String texte, string tri) |
|
|
|
|
public IEnumerable<CollaborateurDTO> GetCollaborateurs(bool? asc, int? numPage, int? parPage, List<string> fonctions, int? idAgence, int? idBU, string texte, string tri) |
|
|
|
|
{ |
|
|
|
|
if (texte == null) |
|
|
|
|
texte = ""; |
|
|
|
|
else |
|
|
|
|
texte = texte.ToLower(); |
|
|
|
|
List<Collaborateur> collaborateurs; |
|
|
|
|
List<CollaborateurDTO> collaborateursDTO; |
|
|
|
|
IEnumerable<Collaborateur> collaborateurs; |
|
|
|
|
IEnumerable<CollaborateurDTO> collaborateursDTO; |
|
|
|
|
if(idBU != null) |
|
|
|
|
collaborateurs = collaborateurApi.ChercherCollabBU(idBU); |
|
|
|
|
else if( idAgence != null) |
|
|
|
@ -59,12 +59,12 @@ namespace EPAServeur.Services |
|
|
|
|
int take = parPage.Value; |
|
|
|
|
collaborateursDTO = (from c in collaborateurs |
|
|
|
|
where (c.Nom + " " + c.Prenom).ToLower().Contains(texte) || (c.Prenom + " " + c.Nom).ToLower().Contains(texte) |
|
|
|
|
select GetCollaborateurDTO(c)).Skip(skip).Take(take).ToList(); |
|
|
|
|
select GetCollaborateurDTO(c)).Skip(skip).Take(take); |
|
|
|
|
|
|
|
|
|
return collaborateursDTO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<CollaborateurDTO> GetCollaborateursByReferent(Guid? idReferent, bool? asc, int? numPage, int? parPage, String texte, string tri) |
|
|
|
|
public IEnumerable<CollaborateurDTO> GetCollaborateursByReferent(Guid? idReferent, bool? asc, int? numPage, int? parPage, string texte, string tri) |
|
|
|
|
{ |
|
|
|
|
if (texte == null) |
|
|
|
|
texte = ""; |
|
|
|
@ -73,12 +73,12 @@ namespace EPAServeur.Services |
|
|
|
|
Collaborateur referent = collaborateurApi.ChercherCollabId(idReferent); |
|
|
|
|
if (referent == null) |
|
|
|
|
return null; |
|
|
|
|
List<Collaborateur> collaborateurs = collaborateurApi.ChercherCollabRef(idReferent); |
|
|
|
|
IEnumerable<Collaborateur> collaborateurs = collaborateurApi.ChercherCollabRef(idReferent); |
|
|
|
|
int skip = (numPage.Value - 1) * parPage.Value; |
|
|
|
|
int take = parPage.Value; |
|
|
|
|
List<CollaborateurDTO> collaborateursDTO = (from c in collaborateurs |
|
|
|
|
IEnumerable<CollaborateurDTO> collaborateursDTO = (from c in collaborateurs |
|
|
|
|
where (c.Nom + " " + c.Prenom).ToLower().Contains(texte) || (c.Prenom + " " + c.Nom).ToLower().Contains(texte) |
|
|
|
|
select GetCollaborateurDTO(c)).Skip(skip).Take(take).ToList(); |
|
|
|
|
select GetCollaborateurDTO(c)).Skip(skip).Take(take); |
|
|
|
|
return collaborateursDTO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|