|
|
@ -6,15 +6,21 @@ using namespace std;
|
|
|
|
using namespace reseau;
|
|
|
|
using namespace reseau;
|
|
|
|
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
int main(){
|
|
|
|
menu();
|
|
|
|
Personne p1{"Bob"};
|
|
|
|
Personne p1{"Bernard","Tapie","0612345701"};
|
|
|
|
Personne p2{"Domi"};
|
|
|
|
Personne p2{"Lionel","Pessi","0608345702"};
|
|
|
|
Personne p3{"Anne"};
|
|
|
|
Personne p3{"Pristiano","Penaldo","0620345703"};
|
|
|
|
Personne p4{"Elie"};
|
|
|
|
Personne p4{"Léon","Blum","0635345704"};
|
|
|
|
Personne p5{"Cali"};
|
|
|
|
Personne p5{"Karim","Benzema","0648345705"};
|
|
|
|
Personne p6{"Samuel"};
|
|
|
|
Personne p6{"Jean-Pierre","Pernault","0655345706"};
|
|
|
|
Personne p7{"Elena"};
|
|
|
|
Personne p7{"Johnny","Hallyday","0664345707"};
|
|
|
|
Personne p8{"Baptiste"};
|
|
|
|
Personne p8{"Jahseh-Dwayne ","Ricardo","0670345708"};
|
|
|
|
Personne p9{"Franck"};
|
|
|
|
|
|
|
|
Personne p10{"Agathe"};
|
|
|
|
|
|
|
|
Personne p11{"Louna"};
|
|
|
|
|
|
|
|
Personne p12{"Theo"};
|
|
|
|
|
|
|
|
Personne p13{"Morgane"};
|
|
|
|
|
|
|
|
Personne p14{"Thibault"};
|
|
|
|
|
|
|
|
Personne p15{"Gwen"};
|
|
|
|
cout << "----------\n";
|
|
|
|
cout << "----------\n";
|
|
|
|
Contact c1{p1};
|
|
|
|
Contact c1{p1};
|
|
|
|
Contact c2{p2};
|
|
|
|
Contact c2{p2};
|
|
|
@ -24,109 +30,83 @@ int main(){
|
|
|
|
Contact c6{p6};
|
|
|
|
Contact c6{p6};
|
|
|
|
Contact c7{p7};
|
|
|
|
Contact c7{p7};
|
|
|
|
Contact c8{p8};
|
|
|
|
Contact c8{p8};
|
|
|
|
|
|
|
|
Contact c9{p9};
|
|
|
|
|
|
|
|
Contact c10{p10};
|
|
|
|
|
|
|
|
Contact c11{p11};
|
|
|
|
|
|
|
|
Contact c12{p12};
|
|
|
|
|
|
|
|
Contact c13{p13};
|
|
|
|
|
|
|
|
Contact c14{p14};
|
|
|
|
|
|
|
|
Contact c15{p15};
|
|
|
|
cout << "----------\n";
|
|
|
|
cout << "----------\n";
|
|
|
|
c1.ajouterContact(p2);
|
|
|
|
c1.ajouterContact(p2);
|
|
|
|
c1.ajouterContact(p3);
|
|
|
|
c1.ajouterContact(p5);
|
|
|
|
c1.ajouterContact(p4);
|
|
|
|
c1.ajouterContact(p4);
|
|
|
|
c1.ajouterContact(p2);
|
|
|
|
c3.ajouterContact(p1);
|
|
|
|
c2.ajouterContact(p1);
|
|
|
|
c3.ajouterContact(p2);
|
|
|
|
c1.ajouterContact(p1);
|
|
|
|
c4.ajouterContact(p5);
|
|
|
|
|
|
|
|
c5.ajouterContact(p4);
|
|
|
|
|
|
|
|
c6.ajouterContact(p7);
|
|
|
|
|
|
|
|
c6.ajouterContact(p9);
|
|
|
|
|
|
|
|
c7.ajouterContact(p3);
|
|
|
|
|
|
|
|
c8.ajouterContact(p2);
|
|
|
|
|
|
|
|
c9.ajouterContact(p6);
|
|
|
|
|
|
|
|
c9.ajouterContact(p11);
|
|
|
|
|
|
|
|
c10.ajouterContact(p7);
|
|
|
|
|
|
|
|
c10.ajouterContact(p8);
|
|
|
|
|
|
|
|
c11.ajouterContact(p15);
|
|
|
|
|
|
|
|
c12.ajouterContact(p10);
|
|
|
|
|
|
|
|
c13.ajouterContact(p11);
|
|
|
|
|
|
|
|
c14.ajouterContact(p12);
|
|
|
|
|
|
|
|
c14.ajouterContact(p13);
|
|
|
|
|
|
|
|
c15.ajouterContact(p9);
|
|
|
|
|
|
|
|
// cout << "----------\n";
|
|
|
|
|
|
|
|
// c1.rechercher(p3);
|
|
|
|
|
|
|
|
// c1.rechercher(p2);
|
|
|
|
|
|
|
|
// c1.rechercher(p5);
|
|
|
|
cout << "----------\n";
|
|
|
|
cout << "----------\n";
|
|
|
|
c1.rechercher(p3);
|
|
|
|
c1.afficherContactDirect();
|
|
|
|
c1.rechercher(p2);
|
|
|
|
c2.afficherContactDirect();
|
|
|
|
c1.rechercher(p5);
|
|
|
|
c3.afficherContactDirect();
|
|
|
|
|
|
|
|
c4.afficherContactDirect();
|
|
|
|
|
|
|
|
c5.afficherContactDirect();
|
|
|
|
// c1.ajouterContact()
|
|
|
|
c6.afficherContactDirect();
|
|
|
|
// map<Personne,listeContact> m {{p1,[p2,p6]},{}}
|
|
|
|
c7.afficherContactDirect();
|
|
|
|
}
|
|
|
|
c8.afficherContactDirect();
|
|
|
|
|
|
|
|
c9.afficherContactDirect();
|
|
|
|
void menu(){
|
|
|
|
c10.afficherContactDirect();
|
|
|
|
int choix, choix2, choix3;
|
|
|
|
c11.afficherContactDirect();
|
|
|
|
|
|
|
|
c12.afficherContactDirect();
|
|
|
|
string nom,prenom,numtel,message;
|
|
|
|
c13.afficherContactDirect();
|
|
|
|
while(choix!=0){
|
|
|
|
c14.afficherContactDirect();
|
|
|
|
cout <<"Créer une personne(1) S'identifier(2) exit(3)\n"; #Menu1
|
|
|
|
c15.afficherContactDirect();
|
|
|
|
cin >> choix;
|
|
|
|
cout << "----------\n";
|
|
|
|
switch(choix) {
|
|
|
|
c1.afficherContactIndirect();
|
|
|
|
|
|
|
|
c2.afficherContactIndirect();
|
|
|
|
case 1 :
|
|
|
|
c3.afficherContactIndirect();
|
|
|
|
cout << endl << "Rentrez les informations suivantes pour créer une personne : \nNom : \nPrenom : \nNuméro de téléphone : \n";
|
|
|
|
c4.afficherContactIndirect();
|
|
|
|
cin >> nom >> prenom >> numtel ;
|
|
|
|
c5.afficherContactIndirect();
|
|
|
|
const Personne *p = new Personne(nom,prenom,numtel);
|
|
|
|
c6.afficherContactIndirect();
|
|
|
|
const Contact *c = new Contact(Personne);
|
|
|
|
c7.afficherContactIndirect();
|
|
|
|
break;
|
|
|
|
c8.afficherContactIndirect();
|
|
|
|
|
|
|
|
c9.afficherContactIndirect();
|
|
|
|
|
|
|
|
c10.afficherContactIndirect();
|
|
|
|
case 2 :
|
|
|
|
c11.afficherContactIndirect();
|
|
|
|
cout << endl << "Identifiez-vous : \nNom : \n";
|
|
|
|
c12.afficherContactIndirect();
|
|
|
|
cin >> nom ;
|
|
|
|
c13.afficherContactIndirect();
|
|
|
|
if(rechercher(nom)==true){
|
|
|
|
c14.afficherContactIndirect();
|
|
|
|
|
|
|
|
c15.afficherContactIndirect();
|
|
|
|
cout <<"Démarrer(1) Édition(2) retour(3)\n"; #Menu2
|
|
|
|
|
|
|
|
cin >> choix2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(choix2!=0){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(choix2) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 1 :
|
|
|
|
|
|
|
|
cout <<"MENU DÉMARRER\n" << "envoyerMessage afficherMessage afficherContact rechercher retour\n"; #MenuDémarrer
|
|
|
|
|
|
|
|
cin >> choix;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(choix) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 1 :
|
|
|
|
|
|
|
|
cout << "À qui voulez-vous l'envoyer\n Nom : \n Message : \n";
|
|
|
|
|
|
|
|
cin >> nom >> message;
|
|
|
|
|
|
|
|
rechercherPers(nom).envoyerMessage(nom,message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 2 :
|
|
|
|
|
|
|
|
afficherMessage();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 3 :
|
|
|
|
|
|
|
|
cout << rechercherPers(nom).lesContacts << endl;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 4 :
|
|
|
|
|
|
|
|
cout << rechercherPers(nom).lesContacts << endl;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 5 :
|
|
|
|
|
|
|
|
menu();
|
|
|
|
|
|
|
|
cout << nom;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 2 :
|
|
|
|
|
|
|
|
cout <<"MENU ÉDITION\n" << "ajouterContact supprimerContact rechercher retour\n"; #MenuÉdition
|
|
|
|
|
|
|
|
cin >> choix;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(choix) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 1 :
|
|
|
|
|
|
|
|
c1.ajouterContact(p1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 2 :
|
|
|
|
|
|
|
|
cout << endl << "donner chiffre d'affaire : ";
|
|
|
|
|
|
|
|
cin >> CA ;
|
|
|
|
|
|
|
|
const Employe *e = new Representant(nom,prenom,date,CA);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case 3 :
|
|
|
|
|
|
|
|
menu();
|
|
|
|
|
|
|
|
cout << 2 << nom;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else menu();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3 :
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// menu {
|
|
|
|
|
|
|
|
// 1 = technique 1
|
|
|
|
|
|
|
|
// LiaisonDirect()
|
|
|
|
|
|
|
|
// LiaisonIndirect()
|
|
|
|
|
|
|
|
// LiaisonDirect pour une personne()
|
|
|
|
|
|
|
|
// LiaisonIndirect pour une personne()
|
|
|
|
|
|
|
|
// 2 = technique 2
|
|
|
|
|
|
|
|
// LiaisonDirect()
|
|
|
|
|
|
|
|
// LiaisonIndirect()
|
|
|
|
|
|
|
|
// LiaisonDirect pour une personne()
|
|
|
|
|
|
|
|
// LiaisonIndirect pour une personne()
|
|
|
|
|
|
|
|
// }
|
|
|
|