public void UpdateCollaborateur( ajt_collaborator collaborateur) { if (cruder == null) cruder = new Crud<ajt_collaborator>(); cruder.Update(collaborateur); }
public void DeleteCollaborateur( ajt_collaborator collaborateur) { if (cruder == null) cruder = new Crud<ajt_collaborator>(); cruder.Archive(collaborateur); }
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; }
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); }