|
|
|
@ -3,14 +3,14 @@
|
|
|
|
|
|
|
|
|
|
void inputClient(void)
|
|
|
|
|
{
|
|
|
|
|
int numClient = 1, suspended = 0;
|
|
|
|
|
int numClient, suspended = 0;
|
|
|
|
|
float cagnotte = 0;
|
|
|
|
|
FILE *client;
|
|
|
|
|
client = fopen("client.txt", "a");
|
|
|
|
|
if (client == NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("Erreur lors de l'ouverture de 'client.txt'\n");
|
|
|
|
|
return;
|
|
|
|
|
return; //? return est-il mieux placer que exit() dans ce cas ?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (numClient)
|
|
|
|
@ -22,7 +22,7 @@ void inputClient(void)
|
|
|
|
|
printf("Erreur, le numéro du client doit être positif, entrez le numéro du client ou 0 si vous souhaitez arrêter la saisie: ");
|
|
|
|
|
scanf("%d", &numClient);
|
|
|
|
|
}
|
|
|
|
|
fprintf(client, "%d\t%f\t%d", numClient, cagnotte, suspended);
|
|
|
|
|
fprintf(client, "%d\t%f\t%d", numClient, cagnotte, suspended); //? Pourquoi créer les variables 'suspended' et 'cagnotte' ? Mettre directement 0 suffit.
|
|
|
|
|
}
|
|
|
|
|
fclose(client);
|
|
|
|
|
}
|
|
|
|
@ -40,7 +40,7 @@ void modifyClient(void)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (numClient)
|
|
|
|
|
while (numClient) //?! whut
|
|
|
|
|
{
|
|
|
|
|
printf("Entrez le numéro du client cherché ou 0 si vous souhaitez arrêter la saisie: ");
|
|
|
|
|
scanf("%d%*c", &searchedNumClient);
|
|
|
|
@ -53,7 +53,7 @@ void modifyClient(void)
|
|
|
|
|
scanf("%c%*c", &choice);
|
|
|
|
|
while (choice != 's' || choice != 'c')
|
|
|
|
|
{
|
|
|
|
|
printf("Mauvaise saisie, les valeurs correctes sont 's' pour suspendre ou réactiver le compte du client et 'c' pour modifier la cagnotte: ")
|
|
|
|
|
printf("Mauvaise saisie, les valeurs correctes sont 's' pour suspendre ou réactiver le compte du client et 'c' pour modifier la cagnotte: ");
|
|
|
|
|
scanf("%c%*c", &choice);
|
|
|
|
|
}
|
|
|
|
|
// Faire une recherche du numéro client
|
|
|
|
@ -62,7 +62,7 @@ void modifyClient(void)
|
|
|
|
|
{
|
|
|
|
|
if (numClient == searchedNumClient)
|
|
|
|
|
{
|
|
|
|
|
if (choice == s'')
|
|
|
|
|
if (choice == s'') //TODO Misplace là x)))
|
|
|
|
|
if (suspended == 1)
|
|
|
|
|
{
|
|
|
|
|
suspended = 0;
|
|
|
|
@ -81,12 +81,12 @@ void modifyClient(void)
|
|
|
|
|
// Ecrire la modif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fclose(item);
|
|
|
|
|
fclose(client);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("Le numéro client entré n'existe pas")
|
|
|
|
|
}
|
|
|
|
|
fclose(item);
|
|
|
|
|
fclose(client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void inputItem(void)
|
|
|
|
|