Example #1
0
 public void UpdateCollaborateur( ajt_collaborator collaborateur)
 {
     if (cruder == null) cruder = new Crud<ajt_collaborator>();
     cruder.Update(collaborateur);
 }
Example #2
0
 public void DeleteCollaborateur( ajt_collaborator collaborateur)
 {
     if (cruder == null) cruder = new Crud<ajt_collaborator>();
     cruder.Archive(collaborateur);
 }
Example #3
0
 public string GetRoleFromCollaborator(ajt_collaborator coll)
 {
     ICrud<aspnetuser> crud = new Crud<aspnetuser>();
     List<aspnetuser> users = crud.GetAll().ToList();
     aspnetuser user = users.Where(x => x.Id == coll.id_user_fk).FirstOrDefault();
     List<aspnetrole> liste = user.aspnetroles.ToList();
     return liste[0].Name;
 }
Example #4
0
 public void CreateCollaborator(ajt_collaborator collaborateur)
 {
     if (cruder == null) cruder = new Crud<ajt_collaborator>();
     List<ajt_collaborator> liste = cruder.GetAll().Where(x => x.id_user_fk == collaborateur.id_user_fk).ToList();
     if(liste.Count == 0)cruder.AddNew(collaborateur);
 }