|
|
|
@ -48,7 +48,6 @@ int chargeArticles(int reference[], float weight[], float volume[], float unitPr
|
|
|
|
|
if(article==NULL)
|
|
|
|
|
{
|
|
|
|
|
errorHandling(-4);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ref, tL=0;
|
|
|
|
@ -98,8 +97,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su
|
|
|
|
|
client = fopen("clients.txt","r");
|
|
|
|
|
if(client==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("ERREUR: Echec de l'ouverture en lecture de 'clients.txt'.\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
errorHandling(-4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int id, passwd, sus, tL=0, adm;
|
|
|
|
@ -110,7 +108,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su
|
|
|
|
|
{
|
|
|
|
|
if(tL == tmaxArticles)
|
|
|
|
|
{
|
|
|
|
|
printf("Tableau trop petit.\n");
|
|
|
|
|
errorHandling(-3);
|
|
|
|
|
return tL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -166,14 +164,10 @@ void sauvegardeArticles(int reference[], float weight[], float volume[], float u
|
|
|
|
|
article = fopen("articles.txt","w");
|
|
|
|
|
if(article==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("ERREUR: Echec de l'ouverture en écriture de 'articles.txt'.\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
errorHandling(-5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
for(i=0; i<tLogArticle; i++)
|
|
|
|
|
{
|
|
|
|
|
fprintf(article, "%d %f %f %f\n", reference[i], weight[i], volume[i], unitPrice[i]);
|
|
|
|
|
printf("ERREUR: Echec de l'ouverture en écriture de 'clients.txt'.\n");
|
|
|
|
|
exit(1);%f\n", reference[i], weight[i], volume[i], unitPrice[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose(article);
|
|
|
|
@ -196,8 +190,7 @@ void sauvegardeClients(int clientID[], int clientPassword[], float cagnotte[], i
|
|
|
|
|
client = fopen("clients.txt","w");
|
|
|
|
|
if(client==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("ERREUR: Echec de l'ouverture en écriture de 'clients.txt'.\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
errorHandling(-5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|