antoine.perederii 2 years ago
commit 861b645e99

@ -4,10 +4,11 @@
#include <stdbool.h> #include <stdbool.h>
#include "structures.h" #include "structures.h"
void global(void);
/* Menus */ /* Menus */
void choixMenu(ListeDept *tiut[]); void menu(VilleIUT *tiut[], int nbVilles);
void menuUtilisateur(ListeDept *tiut[]); void menuUtilisateur(VilleIUT *tiut[], int nbVilles);
void menuAdministrateur(ListeDept *tiut[]); void menuAdministrateur(VilleIUT *tiut[], int nbVilles);
/* Partie 1 */ /* Partie 1 */
ListeDept listenouv(void); ListeDept listenouv(void);

@ -2,16 +2,6 @@
int main(void) int main(void)
{ {
int nbVilles; global();
VilleIUT *tiut[100];
nbVilles = chargementVillesIUT(tiut);
// affichageVillesIUT(tiut, nbVilles);
affichageDeptIUT(tiut, nbVilles);
// modificationNbPDept(tiut, nbVilles);
// creationDept(tiut, nbVilles);
// nbVilles = suppressionDept(tiut, nbVilles);
//modificationRespDept(tiut, nbVilles);
//affichageDeptIUT(tiut, nbVilles);
sauvegarde(tiut, nbVilles);
return 0; return 0;
} }

BIN
exe

Binary file not shown.

@ -2,6 +2,9 @@
void global(void) void global(void)
{ {
int nbVilles;
VilleIUT *tiut[100];
nbVilles = chargementVillesIUT(tiut);
menu(tiut, nbVilles);
sauvegarde(tiut, nbVilles);
} }

@ -1,4 +1,4 @@
Grenoble Informatique 112 Dupont Jean Grenoble Informatique 112 Dupont Jean
Clermont-Ferrand Biologie 120 Coralie Elebon Clermont-Ferrand Biologie 120 Coralie Elebon
Clermont-Ferrand Informatique 136 Simon Carine Clermont-Ferrand Informatique 136 Simon Carine
Aurillac Bio-Informatique 56 Ayoub Milaki Aurillac Bio-Informatique 56 Ayoub Milaki

@ -1,13 +1,13 @@
#include "SAE.h" #include "SAE.h"
void choixMenu(ListeDept *tiut[]) void menu(VilleIUT *tiut[], int nbVilles)
{ {
int choix; int choix;
bool c = false; bool c = false;
while (c == false) while (c == false)
{ {
system("clear"); // system("clear");
printf("Veuillez choisir votre menu :\n"); printf("\n\nVeuillez choisir votre menu :\n");
printf("\t1 - Menu utilisateur\n"); printf("\t1 - Menu utilisateur\n");
printf("\t2 - Menu administrateur\n"); printf("\t2 - Menu administrateur\n");
printf("\t9 - Quitter\n"); printf("\t9 - Quitter\n");
@ -16,15 +16,16 @@ void choixMenu(ListeDept *tiut[])
switch (choix) switch (choix)
{ {
case 1: case 1:
c = true; c = false;
menuUtilisateur(tiut); menuUtilisateur(tiut, nbVilles);
break; break;
case 2: case 2:
c = true; c = false;
menuAdministrateur(tiut); menuAdministrateur(tiut, nbVilles);
break; break;
case 9: case 9:
c = true; c = true;
return;
break; break;
default: default:
printf("Option non reconnue. Veuillez recommencer.\n"); printf("Option non reconnue. Veuillez recommencer.\n");
@ -33,14 +34,14 @@ void choixMenu(ListeDept *tiut[])
} }
} }
void menuUtilisateur(ListeDept *tiut[]) void menuUtilisateur(VilleIUT *tiut[], int nbVilles)
{ {
int choix; int choix;
bool c = false; bool c = false;
while (c == false) while (c == false)
{ {
system("clear"); // system("clear");
printf("Menu d'utilisateur : Que voulez-vous faire ?\n"); printf("\n\nMenu d'utilisateur : Que voulez-vous faire ?\n");
printf("\t1 - Voir les villes possédant un IUT\n"); printf("\t1 - Voir les villes possédant un IUT\n");
printf("\t2 - Voir les départements dans chaque IUT\n"); printf("\t2 - Voir les départements dans chaque IUT\n");
printf("\t3 - Voir le nombre de places en première année\n"); printf("\t3 - Voir le nombre de places en première année\n");
@ -51,24 +52,24 @@ void menuUtilisateur(ListeDept *tiut[])
switch (choix) switch (choix)
{ {
case 1: case 1:
c = true; c = false;
// affichageVillesIUT(VilleIUT *tiut[], int nb); affichageVillesIUT(tiut, nbVilles);
break; break;
case 2: case 2:
c = true; c = false;
// affichageDeptIUT(VilleIUT *tiut[], int nb); affichageDeptIUT(tiut, nbVilles);
break; break;
case 3: case 3:
c = true; c = false;
// //
break; break;
case 4: case 4:
c = true; c = false;
// //
break; break;
case 9: case 9:
c = true; c = true;
return choixMenu(tiut); return menu(tiut, nbVilles);
default: default:
printf("Option non reconnue. Veuillez recommencer.\n"); printf("Option non reconnue. Veuillez recommencer.\n");
break; break;
@ -76,14 +77,14 @@ void menuUtilisateur(ListeDept *tiut[])
} }
} }
void menuAdministrateur(ListeDept *tiut[]) void menuAdministrateur(VilleIUT *tiut[], int nbVilles)
{ {
int choix; int choix;
bool c = false; bool c = false;
while (c == false) while (c == false)
{ {
system("clear"); // system("clear");
printf("Menu d'administrateur : Que voulez-vous faire ?\n"); printf("\n\nMenu d'administrateur : Que voulez-vous faire ?\n");
printf("\t1 - Modifier le nombre de places dans un département\n"); printf("\t1 - Modifier le nombre de places dans un département\n");
printf("\t2 - Créer un département dans un IUT\n"); printf("\t2 - Créer un département dans un IUT\n");
printf("\t3 - Supprimer un département d'un IUT\n"); printf("\t3 - Supprimer un département d'un IUT\n");
@ -96,31 +97,32 @@ void menuAdministrateur(ListeDept *tiut[])
switch (choix) switch (choix)
{ {
case 1: case 1:
c = true; c = false;
// modificationNbPDept(tiut, nb); modificationNbPDept(tiut, nbVilles);
break; break;
case 2: case 2:
c = true; c = false;
// creationDept(tiut[], nb); creationDept(tiut, nbVilles);
break; break;
case 3: case 3:
c = true; c = false;
// suppressionDept(tiut[], nb); suppressionDept(tiut, nbVilles);
break; break;
case 4: case 4:
c = true; c = false;
// modificationRespDept(tiut, nb); modificationRespDept(tiut, nbVilles);
break; break;
case 5: case 5:
c = true; c = false;
// //
break; break;
case 6: case 6:
c = true; c = false;
// //
break; break;
case 9: case 9:
return choixMenu(tiut); c = true;
return menu(tiut, nbVilles);
break; break;
default: default:
printf("Option non reconnue. Veuillez recommencer.\n"); printf("Option non reconnue. Veuillez recommencer.\n");

@ -1,16 +1,5 @@
#include "SAE.h" #include "SAE.h"
/*
ListeDept chargeListeDept(VilleIUT *tiut[])
{
int i = 0;
ListeDept liste = listenouv();
FILE *file = fopen("informationsIUT.txt", "r");
while (!feof(file))
{
}
}*/
int chargementVillesIUT(VilleIUT *tiut[]) int chargementVillesIUT(VilleIUT *tiut[])
{ {
FILE *file = fopen("informationsIUT.txt", "r"); FILE *file = fopen("informationsIUT.txt", "r");

Loading…
Cancel
Save