-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
170 lines (123 loc) · 4.03 KB
/
Copy pathmain.cpp
File metadata and controls
170 lines (123 loc) · 4.03 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#include <iostream>
#include "start/screens.h"
using namespace std;
int main() {
// for testing
// login as admin: id -> 1 | pw -> qwerty12345
// login as employee: id -> 2000 | pw -> qwerty12345
// login as client: id -> 7000 | pw -> qwerty12345
try {
Screens::runApp();
}
catch (const char *msg) {
cerr << msg;
}
//=====================//
// FileManager fm;
// Admin::initID();
// Employee::initID();
// Client::initID();
//====================//
/*****init test*****/
// //----Admins
// Admin a("nonnah", "1234567890", 90302.50);
// // a.display();
// Admin a2("lollah", "123123123", 75000.304);
// // a2.display();
// fm.addAdmin(a);
// fm.addAdmin(a2);
// // ----Employees
// Employee emp1("Mohamed", "121312351", 56000);
// Employee emp2("Menna", "131512312", 7000.54);
// // emp1.display();
// // emp2.display();
// fm.addEmployee(emp1);
// fm.addEmployee(emp2);
// // ----Clients
// Client cli1("Hassan", "9786412495", 12314.413);
// Client cli2("ahmedawy", "123124123", 99999);
// cli1.display();
// cli2.display();
// fm.addClient(cli1);
// fm.addClient(cli2);
// Load::rewriteAll();
//------------------------
/*****Writing into files*****/
// Load::loadAll();
// FileManager fm;
// fm.removeAllAdmins();
// fm.removeAllClients();
// fm.removeAllEmployees();
// Employee emp1("Mohamed", "qwerty12345", 56000);
// Employee emp2("Menna", "131512312", 7000.54);
// fm.addEmployee(emp1);
// fm.addEmployee(emp2);
// Client cli1("Hassan", "qwerty12345", 12314.413);
// Client cli2("Hussein", "923812344", 123123);
// fm.addClient(cli1);
// fm.addClient(cli2);
// Admin adm1("Ahmed", "qwerty12345", 9000.905);
// Admin adm2("Assem", "12342412412", 11000.970);
// fm.addAdmin(adm1);
// fm.addAdmin(adm2);
// Load::rewriteAll();
//------------------------
/*****Display*****/
// vector<Employee> emps = fm.getAllEmployees();
// vector<Client> clis = fm.getAllClients();
// vector<Admin> adms = fm.getAllAdmins();
// cout << "Testing Employee Output: " << endl;
// for (int i = 0; i < emps.size(); i++) {
// emps[i].display();
// cout << "-----\n";
// }
// cout << "-----------------------------------------------------------------\n";
// cout << "Testing Client Output: " << endl;
// for (int i = 0; i < clis.size(); i++) {
// clis[i].display();
// cout << "-----\n";
// }
// cout << "-----------------------------------------------------------------\n";
// cout << "Testing Admin Output: " << endl;
// for (int i = 0; i < adms.size(); i++) {
// adms[i].display();
// cout << "-----\n";
// }
// cout << "-----------------------------------------------------------------\n";
/*****Editing file info*****/
// adm1.editClient(7000, "Johnny", "12314124123", 5000.9745);
// emp1.editClient(3010, "Ronny", "12314124123", 9000.9745);
// adm1.editEmployee(2000, "Dennis", "qwerty9876", 8900.4032);
/***** Clearing Files *****/
// FilesHelper::clearFile("db/Clients.txt");
// FilesHelper::clearFile("db/Employees.txt");
// FilesHelper::clearFile("db/Admins.txt");
// Admin a = Parser::parseToAdmin("1");
// try {
// Admin a = Parser::parseToAdmin("2");
// Person *p = &a;
// p->display();
// Employee emp = Parser::parseToEmployee("2000");
// emp.searchClient(7010)->display();
// Admin adm = Parser::parseToAdmin("1");
// adm.searchEmployee(2010)->display();
// FilesHelper::showClients();
// fm.addClient(cli1);
// fm.addClient(c2);
// c.display();
// c2.display();
// FilesHelper::showClients();
// try {
// Login::login<Client>(7010, "qwerty0987")->display();
// cout << "--------\n";
// Login::login<Employee>(2000, "121312351")->display();
// cout << "--------\n";
// Login::login<Admin>(7010, "qwerty0987")->display();
// }
// catch (const char *msg) {
// cerr << msg;
// }
// Load::loadEntity<Employee>();
// // Login::load<Client>();
return 0;
}