master
Roxane ROSSETTO 3 years ago
parent 448cc3eca7
commit 67f0cd1caf

@ -27,6 +27,11 @@ Listechx init(void)
return NULL;
}
Listecand initCand(void)
{
return NULL;
}
Choix lireC(FILE *fe)
{
Choix c;
@ -138,7 +143,7 @@ void AffListeCandidat (Listecand l){
}
void AffCandid (Listecand l){
if ( l == NULL ) { printf("Pas de candidat\n"); return;}
if ( l == NULL ) return;
affnomcand( l->cand);
AffCandid ( l->suivcand);
}
@ -169,10 +174,28 @@ Listechx recherchechx (Listechx l, char *nom )//recherche du nom de département
return recherchechx (l->suivchx, nom );
}
Listechx searchChx(Listechx lchx, char *ville, char *dptmt)
{
if (lchx == NULL){return lchx;}
if (strcmp(lchx->chx.ville, ville)==0 && strcmp(lchx->chx.dptmt, dptmt)==0)return lchx;
return searchChx(lchx->suivchx, ville, dptmt);
}
Listecand recherchevilledpt ( Listecand l, char *ville, char *dpt){
if ( l == NULL ) return l;
if ( strcmp( l->cand.lchx->chx.ville , ville ) == 0 && strcmp( l->cand.lchx->chx.dptmt, dpt) == 0) return l;
return recherchevilledpt ( l->suivcand, ville, dpt);
Listecand lca;
Listechx lch;
lch = init();
lca = initCand();
while ( l !=NULL ){
lch = searchChx(l->cand.lchx, ville, dpt);
if(lch != NULL){
lca = Insert (lca, l->cand);
}
l = l->suivcand;
}
return lca;
}
Listechx majchoix (Listechx chx, Choix c){//Mise à jour du de la liste choix en modifiant un maillon
@ -315,9 +338,8 @@ void test (void){
printf("Menu :\n");//Premier affichage menu pour choisir si on veut afficher le menu d'un candidat ou toutes les candidatures
printf("(1) Gestion Candidature\n(2) Affichage Candidature\n");
scanf("%d", &menu1);
printf("%d", menu1);
while (menu1 != 1 && menu1 !=2 ){// Traitement des erreurs
while (menu1 != 1 && menu1 !=2 && menu1 !=3){// Traitement des erreurs
printf("Erreur de saisie veuillez refaire votre choix ! \n");
printf("(1) Gestion Candidature\n");
printf("(2) Affichage Candidature\n");
@ -383,13 +405,15 @@ void test (void){
printf("Entrer le nom du departement dont vous souhaitez afficher les candidats\n");
scanf("%s", nomdpt);
l2cand = recherchevilledpt ( lcand, nomville, nomdpt);
AffCandid (l2cand);
}
}
else if (menu1 == 3){
Save(lcand, nbC);
fclose(fe);
return;
}
Save(lcand, nbC);
fclose(fe);

@ -45,7 +45,7 @@ Informatique
37
Thérèse
Francoise
10.50 12.65 14.45 16.00
10.50 12.65 14.45 16.00
1
Clermont-Ferrand
Bio-Informatique

@ -48,6 +48,7 @@ typedef Mailloncand * Listecand;
Listechx init(void);
Listecand initCand(void);
Choix lirechx (void);//permet de lire un choix selon une entrée stdin
Choix lireC(FILE *fe);//ermet de lire un choix avec un FILe de type fichier.don
Candidat lireCandidat(void);//permet de lire un candidat avec le clavier
@ -64,6 +65,7 @@ void AffCandid (Listecand l);//affiche que le nom
void AffListChoix(Listechx l);//affichage complet de la liste de choix
Listecand recherchenom (Listecand l, char *nom );//recherche par un nom dans une liste de candidats
Listecand recherchenum (Listecand l, int num);//recherche par le numéro dans une liste de candidats
Listechx searchChx(Listechx lchx, char *ville, char *dptmt);
Listechx recherchechx (Listechx l, char *nom );// recherche par le nom d'un depratement dans une listedederpartement
Listecand recherchevilledpt ( Listecand l, char *ville, char *dpt);//recherche et retour de la liste des candidats ayant postuler a un certain departement
Listechx majchoix (Listechx chx, Choix c);// mise jour d'un choix

BIN
test

Binary file not shown.
Loading…
Cancel
Save