|
|
@ -585,29 +585,33 @@ void menuAdmin_creerDepartement(VilleIUT** tiut, int nbVilles) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void menuAdmin_supprimerDepartement(VilleIUT** tiut, int nbVilles) {
|
|
|
|
void menuAdmin_supprimerDepartement(VilleIUT** tiut, int nbVilles) {
|
|
|
|
char searchIUT[LEN_MAX], searchDept[LEN_MAX];
|
|
|
|
if(readStatus() == 0) {
|
|
|
|
|
|
|
|
char searchIUT[LEN_MAX], searchDept[LEN_MAX];
|
|
|
|
|
|
|
|
|
|
|
|
VilleIUT* ville;
|
|
|
|
VilleIUT* ville;
|
|
|
|
|
|
|
|
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez supprimer un département (tapez q pour annuler) : ");
|
|
|
|
printf("Entrez la ville dans laquelle vous souhaitez supprimer un département (tapez q pour annuler) : ");
|
|
|
|
scanf("%s", searchIUT);
|
|
|
|
scanf("%s", searchIUT);
|
|
|
|
|
|
|
|
|
|
|
|
if(strcasecmp(searchIUT, "q") == 0)
|
|
|
|
if(strcasecmp(searchIUT, "q") == 0)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
int i = rechercherVille(tiut, nbVilles, searchIUT);
|
|
|
|
int i = rechercherVille(tiut, nbVilles, searchIUT);
|
|
|
|
|
|
|
|
|
|
|
|
if(i == -1)
|
|
|
|
if(i == -1)
|
|
|
|
fprintf(stderr, "\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT);
|
|
|
|
fprintf(stderr, "\e[1;91mErreur: la ville '%s' n'est pas dans la liste des IUT.\e[0m\n\n", searchIUT);
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
ville = tiut[i];
|
|
|
|
ville = tiut[i];
|
|
|
|
|
|
|
|
|
|
|
|
afficherListeDepartement(tiut, nbVilles, searchIUT);
|
|
|
|
afficherListeDepartement(tiut, nbVilles, searchIUT);
|
|
|
|
|
|
|
|
|
|
|
|
printf("Quel département souhaitez-vous supprimer ? : ");
|
|
|
|
printf("Quel département souhaitez-vous supprimer ? : ");
|
|
|
|
scanf("%*c%[^\n]", searchDept);
|
|
|
|
scanf("%*c%[^\n]", searchDept);
|
|
|
|
|
|
|
|
|
|
|
|
ville->ldept = supprimerDepartement(ville->ldept, searchDept);
|
|
|
|
ville->ldept = supprimerDepartement(ville->ldept, searchDept);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fprintf(stderr, "\e[1;91mErreur: vous ne pouvez pas supprimer de département pendant le recrutement/le traitement des candidatures.\e[0m\n\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|