From 7c8e238b6a468f5acbeb2624cff1a31bac3f8033 Mon Sep 17 00:00:00 2001 From: "jade.van_brabandt" Date: Wed, 11 Jan 2023 15:37:39 +0100 Subject: [PATCH] Candidater --- src/partie2/saeP2.c | 30 ++++++++++++++++++++++++++++-- src/partie2/saeP2.h | 17 +++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/partie2/saeP2.c b/src/partie2/saeP2.c index 338df93..b7b5b20 100644 --- a/src/partie2/saeP2.c +++ b/src/partie2/saeP2.c @@ -3,6 +3,7 @@ #include #include "saeP2.h" #include +#include "../annexe/saeAnnexe.h" candidat* LoadCandid(void) { @@ -154,10 +155,35 @@ void ListeCandidat(int nbcandidat,candidat *tcandidat) printf("Candidat non trouvé"); } -void Candidater() +void Candidater(VilleIUT* tiut[],int *tlogi, candidat* tcandidat, int numcandid) { - + char VilleRech[31]; + printf("Veuillez entrez la ville de l'IUT au quel vous souhaitez candidatez :"); + scanf("%s",VilleRech); + int ind=rechercheIUT(tiut,*tlogi,VilleRech); + if(ind==-1) return; + else + { + char DepRech[31]; + printf("Veuillez entrez le département dans lequel vous souhaitez y postuler :"); + scanf("%s",DepRech); + if (existeDep(tiut[ind]->ldept, DepRech)==0) return; + else + { + int i; + for (i=0;tcandidat[i].numcandid!=numcandid;++i); + voeu* voeu_ajout = (voeu*) malloc (sizeof(voeu)); + strcpy(voeu_ajout->ville,VilleRech); + strcpy(voeu_ajout->dep,DepRech); + voeu_ajout->ddep=0; + voeu_ajout->vcand=0; + tcandidat[i].TabVoeu[tcandidat[i].nbchoix]=voeu_ajout; + tcandidat[i].nbchoix++; + } + + } } + //void gestionPhaseCandidatures(); A FAIRE. \ No newline at end of file diff --git a/src/partie2/saeP2.h b/src/partie2/saeP2.h index eb93739..121eaa0 100644 --- a/src/partie2/saeP2.h +++ b/src/partie2/saeP2.h @@ -17,8 +17,25 @@ typedef struct voeu* TabVoeu[20]; }candidat; +//FIX TEMPORAIRE EN ATTENDANT DE TROUVER MIEUX +typedef struct MaillonDep +{ + char departement[31]; + int nbp; + char resp[51]; + struct MaillonDep* suivant; +} MaillonDep; + +typedef struct +{ + char Ville[31]; + MaillonDep* ldept; +} VilleIUT; +// FIN FIX TEMP + candidat* LoadCandid(void); void SaveCandid(int nbcandidat,candidat *tcandidat); void RechercheCandidat(int ID, int nbcandidat,candidat* tcandidat); void ListeCandidat(int nbcandidat,candidat *tcandidat); +void Candidater(VilleIUT* tiut[],int *tlogi, candidat* tcandidat,int numcandid); //void gestionPhaseCandidatures(); A FAIRE.