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