réglage de divers bugs

doc
louis.germain 2 years ago
parent 984fe2225f
commit cc46697f12

@ -1,17 +1,17 @@
#include "main.h"
void displayItem(int reference[], float weight[], float volume[], float unitPrice[], int tlog)
void displayItem(int tabReference[], float weight[], float volume[], float unitPrice[], int tlog)
{
int reference, index;
printf("Entrez la référence de l'article cherché: ");
scanf("%d", &reference);
index = recherche(reference, reference[], tlog);
index = recherche(reference, tabReference, tlog);
if (index == -1)
{
printf("La référence cherchée n'existe pas");
exit(1);
}
printf("%d\t%f\t%f\t%f", reference[index], weight[index], volume[index], unitPrice[index]);
printf("%d\t%f\t%f\t%f", tabReference[index], weight[index], volume[index], unitPrice[index]);
}
void displayItemList(int reference[], float weight[], float volume[], float unitPrice[], int tlog)

@ -16,13 +16,13 @@ void chargeDonnees(int *tLogArticle, int *tLogClient,int reference[], float weig
int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]);
int chargeClients(int clientID[], float cagnotte[], int suspended[]);
void sauvegardeDonnees(int *tLogArticle, int *tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]);
void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[]);
void sauvegardeClients(int clientID[], float cagnotte[], int suspended[]);
void sauvegardeDonnees(int tLogArticle, int tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]);
void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[], int tLogArticle);
void sauvegardeClients(int clientID[], float cagnotte[], int suspended[], int tLogClient);
//! GESTION CLIENTS
void inputClient(void);
void modifyClient(void);
void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog);
//! GESTION STOCKS
void inputItem(void);

@ -33,7 +33,7 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog)
scanf("%d%*c", &numClient);
index = recherche(numClient, clientID, tlog);
printf("Entrez la modification voulue (s pour suspendre ou réactiver, c pour ajouter à la cagnotte)");
scanf("%c"; &modif);
scanf("%c", &modif);
if (modif == 's')
if (suspended[index] == 0)
suspended[index] = 1;

@ -9,7 +9,7 @@
int recherche(int val, int tab[], int tlog) // Recherche de l'index d'un id (de client ou d'article)
{
int i;
for (i=0, i<tlog, i++)
for (i=0; i<tlog; i++)
{
if (tab[i] == val)
return i;
@ -94,13 +94,13 @@ int chargeClients(int clientID[], float cagnotte[], int suspended[])
return tL;
}
void sauvegardeDonnees(int *tLogArticle, int *tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[])
void sauvegardeDonnees(int tLogArticle, int tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[])
{
*tLogArticle = sauvegardeArticles(reference, weight, volume, unitPrice);
*tLogClient = sauvegardeClients(clientID, cagnotte, suspended);
sauvegardeArticles(reference, weight, volume, unitPrice, tLogArticle);
sauvegardeClients(clientID, cagnotte, suspended, tLogClient);
}
int sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[])
void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[], int tLogArticle)
{
FILE *article;
article = fopen("articles.txt","w");
@ -117,10 +117,9 @@ int sauvegardeArticles(int reference[], float weight[], float volume[], float un
}
fclose(article);
return tLogArticle;
}
int sauvegardeClients(int clientID[], float cagnotte[], int suspended[])
void sauvegardeClients(int clientID[], float cagnotte[], int suspended[], int tLogClient)
{
FILE *client;
client = fopen("clients.txt","w");
@ -137,5 +136,4 @@ int sauvegardeClients(int clientID[], float cagnotte[], int suspended[])
}
fclose(client);
return tLogClient;
}
Loading…
Cancel
Save