Modification de la fonction suppression, changement etat carte

master
Roxane ROSSETTO 2 years ago
parent 96465a1791
commit e37e91d049

@ -217,7 +217,7 @@ void Recharge(int *tptsbought, int place, char *tcateg)
topay = dizpts * 2;
tptsbought[place] += nbpts;
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
}
if (tcateg[place] == 'S')
@ -226,7 +226,7 @@ void Recharge(int *tptsbought, int place, char *tcateg)
topay = dizpts * 4;
tptsbought[place] += nbpts;
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
}
if (tcateg[place] == 'A')
@ -235,7 +235,7 @@ void Recharge(int *tptsbought, int place, char *tcateg)
topay = dizpts * 6;
tptsbought[place] += nbpts;
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
printf("Vous avez désormais %d points sur la carte, vous nous devez %d\n", tptsbought[place], topay);
}
}
@ -682,6 +682,9 @@ void suppr1Client(int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *t
}
}
}
else if( contsuppr == 'N' )
Index(n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
}
Save(tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500, 0);
}
@ -757,7 +760,7 @@ void Index(int *n, int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *
*/
if (choix == 1)
{
creationCompte(&VSUIVANTE, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, *n, 500);
creationCompte(&VSUIVANTE, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, n, 500);
}
if (choix == 2)
@ -787,12 +790,12 @@ void Index(int *n, int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *
}
}
void creationCompte(int *VSUIVANTE, int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg,int n, int tmax)
void creationCompte(int *VSUIVANTE, int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg,int *n, int tmax)
{
char nom[15], prenom[20], categorie, gen, retour;
int age, nclient;
FILE *fe, *fx, *fn;
fe= fopen("donneClient.don", "a");
fe= fopen("donneeClient.don", "a");
fx= fopen("x.don","a");
@ -826,16 +829,16 @@ void creationCompte(int *VSUIVANTE, int *tAd, char tnom[][15], char tpnom[][15],
fprintf(fe,"%c",categorie);
*VSUIVANTE=*VSUIVANTE+1;
*n = *n+1;
fprintf(fx,"\n%d",*VSUIVANTE);
printf("Ajoutez un contact?(O/N)\n");
scanf("%c%*c", &retour);
if (retour == 'O')
creationCompte(VSUIVANTE, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500, n);
creationCompte(VSUIVANTE, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, n, 500);
else
Index(&n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
Index(n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
}
@ -873,7 +876,9 @@ void menuAff (int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstat
void changementEtatCarte ( int nclient ,int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg, int tmax, int n)
{
int nchoix, coderet, pos;
fRecherche(tAd, n, nclient, &coderet, &pos);
if(coderet == 1)
{
printf("\nNouvel état de la carte:");
printf("\nDésactiver(0)");
@ -883,17 +888,23 @@ void changementEtatCarte ( int nclient ,int *tAd, char tnom[][15], char tpnom[][
if (nchoix == 0)
{
fRecherche(tAd, n, nclient, &coderet, &pos);
//fRecherche(tAd, n,nclient, &coderet, &pos);
tstate[pos]= 0;
Index(&n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
}
if (nchoix == 1)
{
fRecherche(tAd, n, nclient, &coderet, &pos);
//fRecherche(tAd, n, nclient, &coderet, &pos);
tstate[pos]= 1;
Index(&n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
}
}
else
{
printf("Client inconnu!");
Index(&n, tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
}
}

Binary file not shown.

@ -8,7 +8,7 @@ void cptAct(int *bad, int *muscu, int *foot, int *squa, int * zumba, int chx);
void affNbParAct(int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg,int n, int tmax);
void suppr1Client(int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg, int *n, int tmax);
char Card(void);//check si le client a la carte
void creationCompte(int *VSUIVANTE,int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg,int n, int tmax);
void creationCompte(int *VSUIVANTE,int *tAd, char tnom[][15], char tpnom[][15], int *tage, int *tstate, int *tacti, int *tpasseoupas, int *tptsbought, int *tptsbonus, char *tcateg,int *n, int tmax);
void fRecherche(int *tAd, int n, int noClient, int *coderet, int *rang);
void Name( char *nom, char *prenom);
int FindData(char *nom, char *prenom, char tnom[][15], char tpnom[][15], int *tpasseoupas, int *tptsbought, char *action, int tmax);

@ -6,4 +6,5 @@
4
5
6
7
7
8
Loading…
Cancel
Save