cration du fichier respon et finition de la partie 2 de mon coté

master
Benjamin BACHELARD 2 years ago
parent c31f37d944
commit 21612cbedd

@ -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;
}

@ -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

@ -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;
}

25
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);
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);

@ -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");

@ -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

Loading…
Cancel
Save