Yann CHAMPEAU 3 years ago
commit 2cba3d3e34

@ -4,6 +4,102 @@
#include "saeP1.h"
#include "../annexe/saeAnnexe.h"
void MenuUser(VilleIUT* lvIUT[],int tlogi)
{
int intUserEntry=0;
printf("#--------------------------------------------------------------------#\n");
printf("| |\n");
printf("| SAE S1.02 |\n");
printf("| |\n");
printf("#--------------------------------------------------------------------#\n\n");
printf("Codes correspondant aux différentes actions :\n\n");
printf("1 : Rechercher les villes possèdant un IUT.\n");
printf("2 : Afficher tout les départements de chaques IUT\n");
printf("3 : Afficher le nombre de place en première année d'un IUT précis avec un département précis\n");
printf("4 : Rechercher les IUTs possèdant un département précis.\n");
printf("9 : Revenir à l'écran de sélection du profil.\n\n");
printf("#--------------------------------------------------------------------#\n\n");
while(intUserEntry!=9)
{
printf("Choisissez l'action que vous voulez exécuter : ");
if (!(scanf("%d",intUserEntry)))printf("Entrée innexacte. Veuillez réessayer");
if (intUserEntry==1) SearchCityWithIUT(VilleIUT* lvIUT[], int tlogi);
if (intUserEntry==2) DepEachIUT(VilleIUT* lvIUT[], int tlogi);
if (intUserEntry==3) SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi);
if (intUserEntry==4) SearchIUTFromDep(VilleIUT* lvIUT[],int tlogi);
if (intUserEntry==9) printf("Sortie en cours.\n");
else printf("Entrée innexacte. Veuillez réessayer");
}
}
void SearchCityWithIUT(VilleIUT* lvIUT[], int tlogi)
{
for (int i=0;i<tlogi;++i) printf("%s",lvIUT[i]->Ville);
}
void DepEachIUT(VilleIUT* lvIUT[], int tlogi)
{
for (int i=0;i<tlogi;++i)
{
printf("%s :",lvIUT[i]->Ville);
MaillonDep* MaillonAct=lvIUT[i]->ldept;
while (MaillonAct!=NULL) printf("\t-%s\n",MaillonAct->departement);
}
}
void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi)
{
char sVille[31];
char sDep[31];
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)
{
MaillonDep* MaillonAct=lvIUT[i]->ldept;
while (MaillonAct!=NULL) printf("%s",MaillonAct->departement);
boolF=1;
MaillonAct=MaillonAct->suivant;
break;
}
}
if (!boolF)
{
printf("La ville n'est pas dans la liste.\nMerci de vérifier l'orthographe.\n");
return;
}
printf("Entrez le nom du département dont vous souhaitez connaitre le nombre de place\n");
scanf("%s",sDep);
MaillonDep* MaillonAct=lvIUT[i]->ldept;
while (MaillonAct!=NULL)
{
if(MaillonAct->departement==sDep)
{
printf("Nombre de place : %d\n",MaillonAct->nbp);
return;
}
MaillonAct=MaillonAct->suivant;
}
printf("Le département n'est pas dans la liste.\nMerci de vérifier l'orthographe.\n");
}
void SearchIUTFromDep(VilleIUT* lvIUT[],int tlogi)
{
char sDep[31];
printf("Merci de renseignez le département dont vous cherchez les IUTs :\n");
scanf("%s",sDep);
for (int i=0;i<tlogi;++i)
{
MaillonDep* MaillonAct=lvIUT[i]->ldept;
if(MaillonAct->departement==sDep) printf("%s",lvIUT[i]->Ville);
}
}
void menuAdmin(void){
printf("#--------------------------------------------------------------------#\n");
printf("| |\n");

@ -20,13 +20,13 @@ typedef struct
void menuConsult();
void SearchCityWithIUT();
void SearchCityWithIUT(VilleIUT* lvIUT[], int tlogi);
void DepEachIUT();
void DepEachIUT(VilleIUT* lvIUT[], int tlogi);
void DelDepFromIUT();
void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi);
void SearchDepInIUT();
void SearchIUTFromDep(VilleIUT* lvIUT[],int tlogi);
//Admin

Loading…
Cancel
Save