-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplanning.cpp
83 lines (70 loc) · 1.47 KB
/
planning.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
Gestion d'un emploi du temps
@author Olivier Delierre
@author Florent Hess
@author Benoît Fantozzi
@author Ilyasse Tissafi
@version 1.0
*/
#include <iostream>
#include <string>
#include <fstream>
#include <cstring>
#include "date.h"
#include "rdv.h"
#include "ChainePersonne.h"
using namespace std;
static const string FICHIER_RDV{ "rdvlist.db" };
static const string FICHIER_USER{ "userlist.db" };
void testChaine()
{
ChainePersonne liste_personnes;
int choix;
string nom;
string prenom;
string telephone;
string mail;
liste_personnes.importer(FICHIER_USER);
while (1)
{
system("cls");
cout << "1. Inserer une personne" << endl;
cout << "2. Supprimer une personne" << endl;
cout << "3. Lister les personnes" << endl;
cin >> choix;
cout << endl;
switch (choix)
{
case 1:
cout << "Nom : ";
cin >> nom;
cout << "Prenom : ";
cin >> prenom;
cout << "Telephone : ";
cin >> telephone;
cout << "Mail : ";
cin >> mail;
liste_personnes.insere_en_ordre({ nom, prenom, telephone, mail });
liste_personnes.exporter(FICHIER_USER);
cout << "La personne a bien ete ajoutee.";
break;
case 2:
cout << "Nom : ";
cin >> nom;
cout << "Prenom : ";
cin >> prenom;
liste_personnes.supprimer(nom, prenom);
liste_personnes.exporter(FICHIER_USER);
cout << "La personne a bien ete supprimee";
break;
case 3:
liste_personnes.afficher_chaine();
break;
}
system("pause");
}
}
int main() {
testChaine();
return 0;
}