merging master in client

pull/3/head
Mathéo Hersan 2 years ago
commit 5d29bea387
No known key found for this signature in database
GPG Key ID: 4EF19C64D78EC91B

BIN
app

Binary file not shown.

@ -1,5 +1,3 @@
101 2.250 2.50 15.75
233 10.00 15.00 32.00
272 6.500 10.00 29.99
464 50.0 25.50 60.00
958 4.75 60.00 32.00
464 50.000000 25.500000 60.000000
958 4.750000 60.000000 32.000000
101 1.000000 1.000000 1.000000

@ -36,18 +36,17 @@ void sauvegardArticles(int tRef[], float tPoids[], float tVol[], float tPrix[],
fe = fopen("donnee/articles.txt", "w");
if ( fe == NULL)
{
perror("fopen");
fprintf(stderr, "\n Problème ouverture ficher\n");
return;
}
for ( i = 0; i < tLogique; i++)
{
fprintf(fe,"%d %f %f %f\n", tRef[i], tPoids[i], tVol[i], tPrix[i]);
fprintf(fe,"\t %d\t %.2f\t %.2f\t %.2f\n", tRef[i], tPoids[i], tVol[i], tPrix[i]);
}
fclose(fe);
}
int ajouterArticle( int tRef[], float tPoids[], float tVol[], float tPrix[], int *tLogique, int tPhysique, int ref, float poids, float volume, float prix)
{
int i = *tLogique;
@ -57,14 +56,12 @@ int ajouterArticle( int tRef[], float tPoids[], float tVol[], float tPrix[], int
fprintf(stderr,"Tableau plein !");
return -2;
}
// SI on trie pas par ref c'est ca
tRef[i] = ref;
tPoids[i] = poids;
tVol[i] = volume;
tPrix[i] = prix;
(*tLogique)++;
return 0;
}
void rechercheRefArticle(int tRef[], int ref, int *index, int tLogique)
@ -77,19 +74,18 @@ void rechercheRefArticle(int tRef[], int ref, int *index, int tLogique)
return;
}
}
fprintf(stderr, "\t Article non trouvé.\n");
*index = -1;
return;
}
void supprimerArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int *tLogique)
{
int ref, index;
affichSupprimerArticle(&ref);
rechercheRefArticle(tRef, ref, &index, *tLogique);
for( int i = index; i< *tLogique-1; ++i)
for( int i = index; i < *tLogique-1; ++i)
{
tRef[i] = tRef[i+1];
tPoids[i] = tPoids[i+1];
@ -110,4 +106,17 @@ void modifierArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], in
tVol[index] = volume;
tPrix[index] = prix;
}
void ajouterClient(int tNumClient[], float tCagnotte[], int tSus[], int *tLogique, int tPhysique)
{
int numC = 0;
affichAjoutClient(tNumClient, *tLogique, &numC);
tNumClient[*tLogique] = numC;
tCagnotte[*tLogique] = 0;
tSus[*tLogique] = 0;
(*tLogique)++;
return;
}

@ -5,4 +5,5 @@ void sauvegardArticles(int tRef[], float tPoids[], float tVol[], float tPrix[],
int ajouterArticle( int tRef[], float tPoids[], float tVol[], float tPrix[], int *tLogique, int tPhysique, int ref, float poids, float volume, float prix);
void rechercheRefArticle(int tRef[], int ref, int *index, int tLogique);
void supprimerArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int *tLogique);
void modifierArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique);
void modifierArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique);
void ajouterClient(int tNumClient[], float tCagnotte[], int tSus[], int *tLogique, int tPhysique);

@ -36,4 +36,4 @@ int main(){
}
return 0;
}
}
Loading…
Cancel
Save