You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
4.1 KiB
140 lines
4.1 KiB
#include "FonctionsClient.h"
|
|
#include "FonctionsResponsable.h"
|
|
|
|
void global(void)
|
|
{
|
|
int n=0,rep;
|
|
int Tref[100]={0};
|
|
float Tpoid[100]={0},Tvolume[100]={0},Tprix[100]={0},volV,chargeV;;
|
|
n = TableArticle(Tref,Tpoid,Tvolume,Tprix);
|
|
printf("Responsable / Client ? (R[0]/C[1])");
|
|
scanf("%d",&rep);
|
|
while (rep < 0 || rep > 1)
|
|
{
|
|
printf("Erreur; (R[0]/C[1]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
if (rep == 0)
|
|
{
|
|
printf("Bienvenue Mr. le responsable :)\n");
|
|
printf("Que voulez vous faire ? (Gestion d'articles[0]/Gestion de clients[1]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
while (rep != 9)
|
|
{
|
|
while ((rep < 0 || rep > 1) && rep != 9)
|
|
{
|
|
printf("Erreur; (Gestion d'articles[0]/Gestion de clients[1]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
if (rep == 0)
|
|
{
|
|
printf("Que voulez vous faire ? (afficher[0]/afficher article[1]/ajouter[2]/modifier[3]/supprimer[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
while (rep != 9)
|
|
{
|
|
while ((rep < 0 || rep > 3) && rep != 9)
|
|
{
|
|
printf("Erreur; (afficher[0]/afficher article[1]/ajouter[2]/modifier[3]/supprimer[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
if (rep == 0)
|
|
{
|
|
AffichTable(Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 1)
|
|
{
|
|
AffichArticle(Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 2)
|
|
{
|
|
AjoutArticle();
|
|
n = TableArticle(Tref,Tpoid,Tvolume,Tprix);
|
|
printf("\n");
|
|
}
|
|
if (rep == 3)
|
|
{
|
|
ModifArticle(Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 4)
|
|
{
|
|
n = SupprArticle(Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep != 9)
|
|
{
|
|
printf("Que faire ? (afficher[0]/afficher article[1]/ajouter[2]/modifier[3]/supprimer[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
}
|
|
rep=0;
|
|
}
|
|
if (rep == 1)
|
|
{
|
|
modifclientglobal();
|
|
}
|
|
if (rep != 9)
|
|
{
|
|
printf("Que faire ? (Gestion d'articles[0]/Gestion de clients[1]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
}
|
|
}
|
|
if (rep == 1)
|
|
{
|
|
printf("Bienvenue Mr. le client :)\n");
|
|
volV = initVoiture(&chargeV);
|
|
printf("Que voulez vous faire ? (Ajout[0]/ModifierArticle[1]/SupprimerArticle[2]/AfficherPanier[3]/ResetPanier[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
int TrefC[200]={0},TquanC[200]={0},nArticle=0;
|
|
while (rep != 9)
|
|
{
|
|
while ((rep < 0 || rep > 4) && rep != 9)
|
|
{
|
|
printf("Erreur; (Ajout[0]/ModifierArticle[1]/SupprimerArticle[2]/AfficherPanier[3]/ResetPanier[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
if (rep == 0)
|
|
{
|
|
nArticle = ajoutPanier(TrefC,TquanC,nArticle,Tref,n);
|
|
affichPanier(TrefC,TquanC,nArticle,Tref,Tpoid,Tvolume,Tprix,chargeV,volV,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 1)
|
|
{
|
|
ModifArticlePanier(TrefC,TquanC,nArticle,Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 2)
|
|
{
|
|
nArticle = SupprArticlePanier(TrefC,TquanC,nArticle,Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 3)
|
|
{
|
|
affichPanier(TrefC,TquanC,nArticle,Tref,Tpoid,Tvolume,Tprix,chargeV,volV,n);
|
|
printf("\n");
|
|
}
|
|
if (rep == 4)
|
|
{
|
|
nArticle = ResetPanier(TrefC,TquanC,nArticle);
|
|
printf("\n");
|
|
}
|
|
if (rep != 9)
|
|
{
|
|
printf("Que faire ? (Ajout[0]/ModifierArticle[1]/SupprimerArticle[2]/AfficherPanier[3]/ResetPanier[4]/quitter[9]) ");
|
|
scanf("%d",&rep);
|
|
}
|
|
|
|
}
|
|
}
|
|
EcrireFichier(Tref,Tpoid,Tvolume,Tprix,n);
|
|
printf("Au revoir !\n");
|
|
}
|
|
int main(void)
|
|
{
|
|
global();
|
|
return 0;
|
|
} |