diff --git a/Candidat.c b/Candidat.c index 89ec68e..426335f 100644 --- a/Candidat.c +++ b/Candidat.c @@ -152,3 +152,14 @@ int rechercheCandidatParDeaprtement(ListeC ld,char *departement, int nc){ } return-1; } +int rechercheCandidatParVille(ListeC ld,char *departement ,char *Ville, int nc){ + int emp,emp1,i=0; + while(ld!=NULL){ + emp = strcmp(Ville, ld->ville); + emp1 = strcmp(departement, ld->departement); + if(emp==0 && emp1==0) + return emp; + ld = ld->suivant; + } + return-1; +} \ No newline at end of file diff --git a/Candidat.don b/Candidat.don index 3891d3c..38e9331 100644 --- a/Candidat.don +++ b/Candidat.don @@ -4,7 +4,7 @@ Grenoble Bio-Info 0 0 Aurillac Informatique 0 0 226584 bachelard benjamin 20 17.5 19 19 3 Clermont Informatique 0 0 -Grenoble Informatique 0 0 +Grenoble Biologie 0 0 Aurillac Informatique 0 0 226584 deni martin 14 11.5 19 14 3 Clermont Biologie 0 0 diff --git a/adminIut.c b/adminIut.c index 3e41e99..d47333d 100644 --- a/adminIut.c +++ b/adminIut.c @@ -191,8 +191,7 @@ void MenuAdministrateur(VilleIUT *tiut[],int n){ return ld; } int fsauvegarde(VilleIUT *tiut[], Candidat *tcandidat[], int n, int nc, int choix, int tmax){ -int i, k, j; - +int i, k, j; //Sauvegarde du fichier d'adhérents FILE *fe; fe=fopen("ville.don","w"); @@ -217,10 +216,8 @@ int i, k, j; } } } - fclose(fe); - - //Sauvegarde du fichier d'activités - + fclose(fe); + //Sauvegarde du fichier d'activités FILE *fe2; fe2=fopen("Candidat.don","w"); //Ici, le a permet d'écrire à la suite des informations précédentes dans le fichier sans les supprimer if(fe==NULL){ @@ -244,7 +241,6 @@ int i, k, j; } } fclose(fe2); - return 0; } return 0; } \ No newline at end of file diff --git a/iut.h b/iut.h index 1eaf7d9..2cee448 100644 --- a/iut.h +++ b/iut.h @@ -23,6 +23,7 @@ typedef struct liste1{ char nom[50]; char prenom[50]; note note; + float moy; int nb_choix; ListeC lchoix; struct liste1 *suivant; @@ -65,8 +66,10 @@ typedef enum {faux,vrai}Booleen; void MenuCandidat(Candidat *tcandidat[],VilleIUT *tiut[],int nc); void afficheCandidat(Candidat *tcandidat[], int i); int rechercheCandidatParDeaprtement(ListeC ld,char *departement, int nc); - //recherche - //MaillonDept recherche (MaillonDept *Ville,char *departement,char *responsable); + int rechercheCandidatParVille(ListeC ld, char *departement ,char *Ville, int nc); + +//Menu Responsable + void MenuRespon(Candidat *tcandidat[], VilleIUT *tiut[], int n,int nc); //Liste: VilleIUT Initialisation(void); @@ -83,13 +86,13 @@ typedef enum {faux,vrai}Booleen; void affichage (VilleIUT *tiut[],int n); void affichageListe(ListeD ld); - // fonction de sauvegarde - int fsauvegarde(VilleIUT *tiut[], Candidat *tcandidat[], int n, int nc, int choix, int tmax); //Candidat+choix - int chargementcandidat(Candidat *tcandidat[],int tmax); - Candidat lireCandidat(FILE *fe1, int *nbChoix); - Choix lireChoix(FILE *fe1); - ListeC InsertionTeteCandidat(ListeC ld, char *ville, char *departement, int decision, int validation); - ListeC InsertionCandidat(ListeC ld, char *ville, char *departement, int decision, int validation); - void affichageCandidatchoix(Candidat *tcandidat[],int n); - void affichageListeCandidatchoix(ListeC ld); \ No newline at end of file + int chargementcandidat(Candidat *tcandidat[],int tmax); + Candidat lireCandidat(FILE *fe1, int *nbChoix); + Choix lireChoix(FILE *fe1); + ListeC InsertionTeteCandidat(ListeC ld, char *ville, char *departement, int decision, int validation); ListeC InsertionCandidat(ListeC ld, char *ville, char *departement, int decision, int validation); + void affichageCandidatchoix(Candidat *tcandidat[],int n); + void affichageListeCandidatchoix(ListeC ld); + + // fonction de sauvegarde + int fsauvegarde(VilleIUT *tiut[], Candidat *tcandidat[], int n, int nc, int choix, int tmax); diff --git a/testIut.c b/testIut.c index 73898b0..4c14eaa 100644 --- a/testIut.c +++ b/testIut.c @@ -21,7 +21,7 @@ int main(){ affichage(tiut,n); printf("\n\n\n\t\tTableau Candidat et choix\n"); affichageCandidatchoix(tcandidat,nc); - printf("\n\nUtilisateur - 1\tAdministrateur - 2\tMenu Candidat - 3\tSauvegarder et quitter - 4\n\n"); + printf("\n\nUtilisateur - 1\tAdministrateur - 2\tCandidat - 3\tResponsable - 4\tSauvegarder et quitter - 5\n:"); scanf("%d",&choix); if(choix==1){ printf("\nMenu Utilisateur"); @@ -36,6 +36,10 @@ int main(){ MenuCandidat(tcandidat, tiut, nc); } if(choix==4){ + printf("\nMenu Responsable"); + MenuRespon(tcandidat, tiut, n, nc); + } + if(choix==5){ printf(">----------------------------------------<\n\n"); codeErr = fsauvegarde(tiut, tcandidat, n, nc, choix, 200); printf("\tTous les fichiers sauvegardés.\n\n"); diff --git a/ville.don b/ville.don index 67c9cb6..0483d3f 100644 --- a/ville.don +++ b/ville.don @@ -1,6 +1,6 @@ Grenoble 2 Informatique 112 Dupont-Jean A -Biologie 200 kiki A +Biologie 200 kiki D Clermont 2 Informatique 136 Simon-Carine D Biologie 120 Djojo D