Ajout de la fonction modifNomResponsable() permettant de modifier le nom du responsable d'un département.

master
Yann CHAMPEAU 3 years ago
parent 8fb24ed205
commit 1d1a951ea4

@ -3,6 +3,7 @@
#include <errno.h> #include <errno.h>
#include "saeP1.h" #include "saeP1.h"
#include "../annexe/saeAnnexe.h" #include "../annexe/saeAnnexe.h"
#include "../partie2/saeP2.h"
//Partie Consultant. //Partie Consultant.
@ -105,6 +106,8 @@ void SearchIUTFromDep(VilleIUT* lvIUT[],int tlogi)
//Partie Administrateur. //Partie Administrateur.
void menuAdmin(VilleIUT* tiut[],int tlogi){ void menuAdmin(VilleIUT* tiut[],int tlogi){
int quit=0;
while(!quit){
printf("#--------------------------------------------------------------------#\n"); printf("#--------------------------------------------------------------------#\n");
printf("| |\n"); printf("| |\n");
printf("| SAE S1.02 |\n"); printf("| SAE S1.02 |\n");
@ -123,28 +126,33 @@ void menuAdmin(VilleIUT* tiut[],int tlogi){
scanf("%d",&act); scanf("%d",&act);
switch(act){ switch(act){
case 1: case 1:
modifPlaces(tiut,int tlogi); modifPlaces(tiut,tlogi);
reset(); reset();
break; break;
case 2: case 2:
creerDep(VilleIUT* tiut{},int tlogi); creerDep(tiut,tlogi);
reset(); reset();
break; break;
case 3: case 3:
supprimerDep(tiut,tlogi);
reset(); reset();
break; break;
case 4: case 4:
//gestionPhaseCandidatures(); A Faire (Partie 2).
reset(); reset();
break; break;
case 5: case 5:
modifNomResponsable(tiut,tlogi)
reset(); reset();
break; break;
case 6: case 9:
quit=1
reset(); reset();
} }
} }
}
void modifPlaces(VilleIUT* tiut{},int tlogi){ void modifPlaces(VilleIUT* tiut[],int tlogi){
printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):"); printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):");
char* ville[31]; char* ville[31];
scanf("%*c%s",&ville); scanf("%*c%s",&ville);
@ -172,7 +180,7 @@ void modifPlaces(VilleIUT* tiut{},int tlogi){
return; return;
} }
void creerDep(VilleIUT* tiut{},int tlogi){ void creerDep(VilleIUT* tiut[],int tlogi){
printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):"); printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):");
char* ville[31]; char* ville[31];
scanf("%*c%s",&ville); scanf("%*c%s",&ville);
@ -205,7 +213,7 @@ void creerDep(VilleIUT* tiut{},int tlogi){
return; return;
} }
void supprimerDep(VilleIUT* tiut{},int tlogi){ void supprimerDep(VilleIUT* tiut[],int tlogi){
printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):"); printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):");
char* ville[31]; char* ville[31];
scanf("%*c%s",&ville); scanf("%*c%s",&ville);
@ -243,3 +251,31 @@ void supprimerDep(VilleIUT* tiut{},int tlogi){
printf("\n\nLe département %s de l'IUT de %s a bien été supprimé.\n",dep,ville); printf("\n\nLe département %s de l'IUT de %s a bien été supprimé.\n",dep,ville);
return; return;
} }
void modifNomResponsable(VilleIUT* tiut[],int tlogi){
printf("\nEntrez la ville correspondant à l'IUT à modifier (Q pour abandonner):");
char* ville[31];
scanf("%*c%s",&ville);
if(ville=="Q") return;
int noVille=rechercheTabPtVilleIUT(tiut,tlogi,ville);
if(noVille<=0){
fprintf(stderr,"\nVille non existante !\n");
return;
}
VilleIUT* v=tiut[noVille];
printf("\n\nEntrez le département à modifier:");
char dep[31];
scanf("%*c%s",&dep);
if(!existe(tiut->ldept,dep)){
fprintf(stderr,"\nDépartement non existant !\n");
return;
}
MaillonDep* m=v->ldept
while(m->departement!=dep) m=m->suivant;
printf("\n\nLe responsable du département %s de l'IUT de la ville de %s est actuellement %s. Quel est le nom du nouveau responsable ?\n\n",m->departement,v->Ville,m->resp);
int nom;
scanf("%d",&nom);
m->resp=nom;
printf("\n\nLe nom du responsable du département %s de l'IUT de %s a bien été changé pour %s.\n",dep,ville,nom);
return;
}

@ -32,10 +32,8 @@ void menuAdmin(VilleIUT* tiut[],int tlogi);
void modifPlaces(VilleIUT* tiut[],int tlogi); void modifPlaces(VilleIUT* tiut[],int tlogi);
void creerDep(VilleIUT* tiut{},int tlogi); void creerDep(VilleIUT* tiut[],int tlogi);
void supprimerDep(VilleIUT* tiut{},int tlogi); void supprimerDep(VilleIUT* tiut[],int tlogi);
//void gestionPhaseCandidatures(); void modifNomResponsable(VilleIUT* tiut[],int tlogi);
//void modifNomResponsable();
Loading…
Cancel
Save