-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsListUsersScreen.h
62 lines (46 loc) · 2.02 KB
/
clsListUsersScreen.h
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
#pragma once
#include <iostream>
#include "clsScreen.h"
#include "clsUser.h"
#include <iomanip>
class clsListUsersScreen :protected clsScreen
{
private:
static void _PrintUserRecordLine(clsUser User)
{
cout << setw(8) << left << "" << "| " << setw(12) << left << User.UserName;
cout << "| " << setw(25) << left << User.FullName();
cout << "| " << setw(12) << left << User.Phone;
cout << "| " << setw(20) << left << User.Email;
cout << "| " << setw(10) << left << clsUtil::DecryptText(User.Password,19);
cout << "| " << setw(12) << left << User.Permissions;
}
public:
static void ShowUsersList()
{
vector <clsUser> vUsers = clsUser::GetUsersList();
string Title = "\t User List Screen";
string SubTitle = "\t (" + to_string(vUsers.size()) + ") User(s).";
_DrawScreenHeader(Title, SubTitle);
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "______________________________________________\n" << endl;
cout << setw(8) << left << "" << "| " << left << setw(12) << "UserName";
cout << "| " << left << setw(25) << "Full Name";
cout << "| " << left << setw(12) << "Phone";
cout << "| " << left << setw(20) << "Email";
cout << "| " << left << setw(10) << "Password";
cout << "| " << left << setw(12) << "Permissions";
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "______________________________________________\n" << endl;
if (vUsers.size() == 0)
cout << "\t\t\t\tNo Users Available In the System!";
else
for (clsUser User : vUsers)
{
_PrintUserRecordLine(User);
cout << endl;
}
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "______________________________________________\n" << endl;
}
};