|
|
|
@ -31,14 +31,14 @@ public class CollaborateursService : GenericsServices<CollaborateurSqlDto, Colla |
|
|
|
|
return (entitySqlValidation.ToApi(),0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override CollaborateurApiDto? Update(CollaborateurApiDto apiDto) |
|
|
|
|
public (CollaborateurApiDto?,int) Update(CollaborateurApiDto apiDto) |
|
|
|
|
{ |
|
|
|
|
if (GetById(apiDto.Id) == null) |
|
|
|
|
return null; |
|
|
|
|
return (null,1); |
|
|
|
|
|
|
|
|
|
if (GetAll().Where(collab => apiDto.ApsideMail == collab.ApsideMail && apiDto.Id != collab.Id).Any()) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
return (null,2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -47,9 +47,9 @@ public class CollaborateursService : GenericsServices<CollaborateurSqlDto, Colla |
|
|
|
|
CollaborateurSqlDto? sqlDtoValidation = CollaborateurRepository.Update(sqlDto); |
|
|
|
|
|
|
|
|
|
if (sqlDtoValidation == null) |
|
|
|
|
return null; |
|
|
|
|
return (null,3); |
|
|
|
|
|
|
|
|
|
return sqlDtoValidation.ToApi(); |
|
|
|
|
return (sqlDtoValidation.ToApi(),0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<CollaborateurApiDto> GetCollaborateursByBusinessUnit(uint businessUnitId) |
|
|
|
|