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.
sae2.02/src/main.cpp

133 lines
2.9 KiB

#include <iostream>
#include "Personne.hpp"
#include"Contact.hpp"
using namespace std;
using namespace reseau;
int main(){
menu();
Personne p1{"Bernard","Tapie","0612345701"};
Personne p2{"Lionel","Pessi","0608345702"};
Personne p3{"Pristiano","Penaldo","0620345703"};
Personne p4{"Léon","Blum","0635345704"};
Personne p5{"Karim","Benzema","0648345705"};
Personne p6{"Jean-Pierre","Pernault","0655345706"};
Personne p7{"Johnny","Hallyday","0664345707"};
Personne p8{"Jahseh-Dwayne ","Ricardo","0670345708"};
cout << "----------\n";
Contact c1{p1};
Contact c2{p2};
Contact c3{p3};
Contact c4{p4};
Contact c5{p5};
Contact c6{p6};
Contact c7{p7};
Contact c8{p8};
cout << "----------\n";
c1.ajouterContact(p2);
c1.ajouterContact(p3);
c1.ajouterContact(p4);
c1.ajouterContact(p2);
c2.ajouterContact(p1);
c1.ajouterContact(p1);
cout << "----------\n";
c1.rechercher(p3);
c1.rechercher(p2);
c1.rechercher(p5);
// c1.ajouterContact()
// map<Personne,listeContact> m {{p1,[p2,p6]},{}}
}
void menu(){
int choix, choix2, choix3;
string nom,prenom,numtel,message;
while(choix!=0){
cout <<"Créer une personne(1) S'identifier(2) exit(3)\n"; #Menu1
cin >> choix;
switch(choix) {
case 1 :
cout << endl << "Rentrez les informations suivantes pour créer une personne : \nNom : \nPrenom : \nNuméro de téléphone : \n";
cin >> nom >> prenom >> numtel ;
const Personne *p = new Personne(nom,prenom,numtel);
const Contact *c = new Contact(Personne);
break;
case 2 :
cout << endl << "Identifiez-vous : \nNom : \n";
cin >> nom ;
if(rechercher(nom)==true){
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;
}
}
}