master
Jade VAN BRABANDT 3 years ago
parent ad820cf62e
commit 2ee61e1263

BIN
SAE

Binary file not shown.

@ -75,11 +75,11 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi)
int boolF=0, i;
printf("Entrez le nom de la ville contenant le département recherché :\n");
scanf("%s",sVille);
printf("Département y étant disponible :\n");
for (i=0;i<tlogi;++i)
{
if (lvIUT[i]->Ville==sVille)
if (strcmp(lvIUT[i]->Ville,sVille))
{
printf("Département y étant disponible :\n");
MaillonDep* MaillonAct=lvIUT[i]->ldept;
while (MaillonAct!=NULL) printf("%s",MaillonAct->departement);
boolF=1;
@ -98,7 +98,7 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi)
while (MaillonAct!=NULL)
{
if(MaillonAct->departement==sDep)
if(strcmp(MaillonAct->departement,sDep))
{
printf("Nombre de place : %d\n",MaillonAct->nbp);
return;

@ -2,6 +2,7 @@
#include <stdlib.h>
#include <errno.h>
#include "saeP2.h"
#include <string.h>
candidat* LoadCandid(void)
{
@ -15,93 +16,72 @@ candidat* LoadCandid(void)
//Lire la première ligne pr savoir combien d'étudiant je vais lire
int nbcandid;
fread(&nbcandid,sizeof(int),1,file);
candidat* Listecandidat=(candidat*) malloc (sizeof(candidat)*nbcandid);
candidat* Tabcandidat=(candidat*) malloc (sizeof(candidat)*nbcandid);
//Tant que j'ai des étudiants à lire :
for(int i=0;nbcandid>i;++i)
{
//Son numéro, Son nom, Son prenom, liste de note`
candidat Candidat_ajout;
int numcandid;
char surname[31];
char name[31];
float note[4];
fread(&numcandid,sizeof(int),1,file);
fread(surname,sizeof(char)*31,1,file);
fread(name,sizeof(char)*31,1,file);
fread(note,sizeof(int)*4,1,file);
fread(&Candidat_ajout.numcandid,sizeof(int),1,file);
fread(Candidat_ajout.surname,sizeof(char)*31,1,file);
fread(Candidat_ajout.name,sizeof(char)*31,1,file);
fread(Candidat_ajout.note,sizeof(float)*4,1,file);
//Son nb de choix
int nbchoix;
fread(&nbchoix,sizeof(int),1,file);
fread(&Candidat_ajout.nbchoix,sizeof(int),1,file);
//Tant que j'ai pas fait tout ces choix :
voeu* ListeVoeu_ajout=NULL;
for(int y=0;y<nbchoix;++y)
for(int y=0;y<Candidat_ajout.nbchoix;++y)
{
//Je lis La ville, le département, la décision du dep, la validation du candidat
char ville[31];
char dep[31];
int ddep;
int vcand;
fread(ville,sizeof(char)*31,1,file);
fread(dep,sizeof(char)*31,1,file);
fread(&ddep,sizeof(int),1,file);
fread(&vcand,sizeof(int),1,file);
voeu voeu_ajout;
voeu_ajout.ville=ville;
voeu_ajout.dep=dep;
voeu_ajout.ddep=ddep;
voeu_ajout.vcand=vcand;
voeu ListeVoeu_ajout[100];
ListeVoeu_ajout[i]=voeu_ajout;
voeu* voeu_ajout=(voeu*)malloc(sizeof(voeu));
fread(voeu_ajout->ville,sizeof(char)*31,1,file);
fread(voeu_ajout->dep,sizeof(char)*31,1,file);
fread(&voeu_ajout->ddep,sizeof(int),1,file);
fread(&voeu_ajout->vcand,sizeof(int),1,file);
Candidat_ajout.TabVoeu[i]=voeu_ajout;
}
Candidat_ajout.numcandid=numcandid;
Candidat_ajout.surname=surname;
Candidat_ajout.name=name;
Candidat_ajout.note=note;
Candidat_ajout.ListeVoeu=ListeVoeu_ajout;
Listecandidat[i]=Candidat_ajout;
Tabcandidat[i]=Candidat_ajout;
}
//Je sors en disant que le load est sucessful
printf("Chargement réussie.");
return Listecandidat;
return Tabcandidat;
}
/*
void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcand)
void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcandidat)
{
for(int i=0;i<nbcandidat;++i)
{
if(i==nbcandidat)
{
printf("Candidat Trouvé :\n
Numéro : %d\n
Nom : %s\n
Prenom : %s\n
Note de mathématique : %f\n
Note de français : %f\n
Note d'anglais : %f\n
Note de spécialité : %f\n
Nombre de candidature : %d\n
Nombre de voeu : %d\n
Voeu :\n",tcandidat[i].numcandid,tcandidat[i].surname,tcandidat[i].name,
tcandidat[i].note[0],tcandidat[i].note[1],tcandidat[i].note[2],
tcandidat[i].note[3]);
for(int y=0;y<tcand[i].nbvoeu;++y)
printf("Candidat Trouvé :\n\
Numéro : %d\n\
Nom : %s\n\
Prenom : %s\n\
Note de mathématique : %f\n\
Note de français : %f\n\
Note d'anglais : %f\n\
Note de spécialité : %f\n\
Nombre de voeu : %d\n\
Voeu :\n",tcandidat[i].numcandid,tcandidat[i].surname,tcandidat[i].name,\
tcandidat[i].note[0],tcandidat[i].note[1],tcandidat[i].note[2],\
tcandidat[i].note[3],tcandidat[i].nbchoix);
for(int y=0;y<tcandidat[i].nbchoix;++y)
{
printf("Ville : %s\n
Departement : %s\n
Décision département : ",tcandid[i].ListeVoeu[y].ville,tcandid[i].ListeVoeu[y].dep);
if(==0) printf("Dossier non traité\n");
printf("Ville : %s\n\
Departement : %s\n\
Décision département : ",tcandidat[i].TabVoeu[y]->ville,tcandidat[i].TabVoeu[y]->dep);
if(tcandidat[i].TabVoeu[y]->ddep==0) printf("Dossier non traité\n");
else {
if(==1) printf("Admis\n");
if(tcandidat[i].TabVoeu[y]->ddep==1) printf("Admis\n");
else {
if (==2) printf("Liste d'attente\n");
if (tcandidat[i].TabVoeu[y]->ddep==2) printf("Liste d'attente\n");
else printf("Refusé\n");
}
}
printf("Décision du candidat : ")
if(==0) printf("Décision non rendu\n");
printf("Décision du candidat : ");
if(tcandidat[i].TabVoeu[y]->vcand==0) printf("Décision non rendu\n");
else {
if(==1) printf("Accepté\n");
else prinf("Refusé");
if(tcandidat[i].TabVoeu[y]->vcand==1) printf("Accepté\n");
else printf("Refusé");
}
}
return;
@ -110,5 +90,6 @@ void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcand)
printf("Candidat non trouvé");
return;
}
//void gestionPhaseCandidatures(); A FAIRE.*/

@ -12,10 +12,11 @@ typedef struct
int numcandid;
char surname[31];
char name[31];
int note[4];
voeu ListeVoeu[100];
float note[4];
int nbchoix;
voeu* TabVoeu[20];
}candidat;
candidat* LoadCandid(void);
void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat* tcandidat);
//void gestionPhaseCandidatures(); A FAIRE.

Loading…
Cancel
Save