diff --git a/app b/app deleted file mode 100755 index 0458afb..0000000 Binary files a/app and /dev/null differ diff --git a/src/app/core_logic/client.c b/src/app/core_logic/client.c index 92a8936..9f3da5a 100644 --- a/src/app/core_logic/client.c +++ b/src/app/core_logic/client.c @@ -170,5 +170,4 @@ void affiche_recap_panier(int panier[], int taillePanier, int references[], floa printf("Prix total à payer: %.2f euros\n", montantTotal); printf("Volume utilise : %.2f litres\n", volumeTotal); printf("Charge Actuelle: %.2f kg\n", poidsTotal); -} - +} \ No newline at end of file diff --git a/src/app/interface/interface_resp.c b/src/app/interface/interface_resp.c index f316d78..239cab8 100644 --- a/src/app/interface/interface_resp.c +++ b/src/app/interface/interface_resp.c @@ -2,6 +2,7 @@ #include #include "interface_resp.h" #include "app/core_logic/responsable.h" +#include "app/core_logic/client.h" #define MAX_CLIENTS 100 #define MAX_ARTICLES 100 @@ -56,7 +57,7 @@ void affichUnArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], in { int ref; printf("\tQuelle est la référence de l'article à rechercher ?\n"); - while(scanf("%d", &ref != 1 || ref <= 0)) + while(scanf("%d", &ref != 1 || &ref <= 0)) { printf("\tEntrez une référence valide\n"); while(getchar() != '\n'); @@ -153,7 +154,7 @@ void affichSupprimerArticle(int *ref) printf("\t Quel est la référence de l'article voulez-vous supprimez\n"); while(scanf("%d", ref == 1 || *ref <= 0)) { - printf("\t Veuillez entrer une référence valide.") + printf("\t Veuillez entrer une référence valide."); while(getchar() != '\n'); } } @@ -226,33 +227,37 @@ void global_resp(){ int tSus[MAX_CLIENTS]; int tLogArticle = chargementArticles(tRef, tPoids, tVol, tPrix, MAX_ARTICLES); - //int tLogClient = charger_clients(tNumClient, tCagnotte, tSus, MAX_CLIENTS); + int tLogClient = charger_clients(tNumClient, tCagnotte, tSus, MAX_CLIENTS); - menu_resp(&choix); - switch (choix) { - case 1: - affichArticles(tRef, tPoids, tVol, tPrix, tLogArticle); - break; - case 2: - affichUnArticle(tRef, tPoids, tVol, tPrix, tLogArticle); - break; - case 3: - affichUnClient(tNumClient, tCagnotte, tSus, tLogClient); - break; - case 4: - affichClients(tNumClient, tCagnotte, tSus, tLogClient); - break; - case 5: - modifierArticle(tRef, tPoids, tVol, tPrix, tLogArticle); - break; - case 6: - supprimerArticle(tRef, tPoids, tVol, tPrix, &tLogArticle); - break; - case 7: - printf("Ouai tkt ^^'"); - break; - default: - printf("Veuillez entrer un choix valide ! \n"); - break; - } + do { + + + menu_resp(&choix); + switch (choix) { + case 1: + affichArticles(tRef, tPoids, tVol, tPrix, tLogArticle); + break; + case 2: + affichUnArticle(tRef, tPoids, tVol, tPrix, tLogArticle); + break; + case 3: + affichUnClient(tNumClient, tCagnotte, tSus, tLogClient); + break; + case 4: + affichClients(tNumClient, tCagnotte, tSus, tLogClient); + break; + case 5: + modifierArticle(tRef, tPoids, tVol, tPrix, tLogArticle); + break; + case 6: + supprimerArticle(tRef, tPoids, tVol, tPrix, &tLogArticle); + break; + case 7: + printf("Ouai tkt ^^'"); + break; + default: + printf("Veuillez entrer un choix valide ! \n"); + break; + } + } while (choix != 7); } \ No newline at end of file diff --git a/src/app/interface/interface_resp.h b/src/app/interface/interface_resp.h index 707d010..b793ad2 100644 --- a/src/app/interface/interface_resp.h +++ b/src/app/interface/interface_resp.h @@ -1,10 +1,10 @@ void affichArticles( int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique); -void affichUnArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique, int val); +void affichUnArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique); void affichUnClient(int tNumClient[], float tCagnotte[], int tSus[], int tLogique); void affichClients(int tNumClient[], float tCagnotte[], int tSus[], int tLogique); void affichAjoutArticle(int *ref, float *poids, float *volume, float *prix); void affichSupprimerArticle(int *ref); void affichModifierArticle(int *ref, float *poids, float *volume, float *prix); -void menu_resp(int *choix, int jour); +void menu_resp(int *choix); void global_resp(); void affiche_resp(void); \ No newline at end of file