From 027f6a64794b5ca572efb038fe5670ba138ac91a Mon Sep 17 00:00:00 2001 From: loris OBRY Date: Fri, 13 Jan 2023 14:07:21 +0100 Subject: [PATCH] afficherDeptIutDonne, modification de choix pour en faire une liste --- header/sae.h | 7 +++++-- source/sae.c | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/header/sae.h b/header/sae.h index 7c665b9..e548956 100644 --- a/header/sae.h +++ b/header/sae.h @@ -26,13 +26,15 @@ void testColor(void); */ //Proposition structure de candidat & choix pour la partie 2 ( jean ) : -typedef struct +typedef struct choix { char ville[50]; char departement[50]; int decisionDepartement; int validationCandidat; -}Choix; + struct choix *suiv; + +}Choix, *lChoix; typedef struct { @@ -122,6 +124,7 @@ void seConnecterTest(void); int modifiePlacesDept(VilleIut **villeIut, int nbVilles, char *ville, char *nomDept, int nbP); int modifieRespDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomDept[], char nvNomResp[]); +void afficherDeptIutDonne(VilleIut **villeIut, int nbVille); void afficheIUTDept(VilleIut* *villeIut, int nbVilles, char *nomDept); void afficheVillesIUT(VilleIut **villeIut, int nbVilles); void afficheNbPlacesDep(VilleIut *tVilleIut[], int nbVilles, char nomDept[]); diff --git a/source/sae.c b/source/sae.c index 68a7d7c..244dab4 100644 --- a/source/sae.c +++ b/source/sae.c @@ -158,7 +158,7 @@ void menuCandidat(Log * tLog, int nbLog, VilleIut *tIut[], int nbVilles) switch(choix) { case 1: - //afficher une candidature + //affiche les candidatures break; case 2: //Creer une candidature @@ -473,7 +473,7 @@ int modifiePlacesDept(VilleIut **villeIut, int nbVilles, char *ville, char *nomD * * @return 1 si le nom du responsable a été trouvé et modifié, 0 sinon */ -int modifieChefDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomDept[], char nvNomResp[]) +int modifieRespDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomDept[], char nvNomResp[]) { // Recherche de la ville et du département int i; @@ -506,10 +506,21 @@ int modifieChefDept(VilleIut *tVilleIut[], int nbVilles, char ville[], char nomD return 0; } -void afficherDeptIutDonne(VilelIut **villeIut, int nbVille) +void afficherDeptIutDonne(VilleIut **villeIut, int nbVille) { - afficheVillesIUT(); - printf() + int res; + char *nom; + + afficheVillesIUT(villeIut, nbVille); + printf("Veuillez saisir le nom de l'iut que vous voulez afficher.\n"); + scanf("%s", nom); + res = existeIut(villeiut, nbVille, nom); + if (res == -1) + { + printf("Cet IUT n'existe pas\n"); + return ; + } + afficherListe(villeiut[res]->lDept); } /** @@ -873,6 +884,4 @@ ListeCandidats insertionTeteCand( ListeCandidats nvL, ListeCandidats l ) free( l ); return nvL; -} - - +} \ No newline at end of file