-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsClientListScreen.h
69 lines (50 loc) · 2.23 KB
/
clsClientListScreen.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
62
63
64
65
66
67
68
#pragma once
#include <iostream>
#include "clsScreen.h"
#include "clsBankClient.h"
#include <iomanip>
class clsClientListScreen :protected clsScreen
{
private:
static void PrintClientRecordLine(clsBankClient Client)
{
cout << setw(8) << left << "" << "| " << setw(15) << left << Client.AccountNumber();
cout << "| " << setw(20) << left << Client.FullName();
cout << "| " << setw(12) << left << Client.Phone;
cout << "| " << setw(20) << left << Client.Email;
cout << "| " << setw(10) << left << Client.PinCode;
cout << "| " << setw(12) << left << Client.AccountBalance;
}
public:
static void ShowClientsList()
{
if (!CheckAccessRights(clsUser::enPermissions::pListClients))
{
return;// this will exit the function and it will not continue
}
vector <clsBankClient> vClients = clsBankClient::GetClientsList();
string Title = "\t Client List Screen";
string SubTitle = "\t (" + to_string(vClients.size()) + ") Client(s).";
_DrawScreenHeader(Title, SubTitle);
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "_________________________________________\n" << endl;
cout << setw(8) << left << "" << "| " << left << setw(15) << "Accout Number";
cout << "| " << left << setw(20) << "Client Name";
cout << "| " << left << setw(12) << "Phone";
cout << "| " << left << setw(20) << "Email";
cout << "| " << left << setw(10) << "Pin Code";
cout << "| " << left << setw(12) << "Balance";
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "_________________________________________\n" << endl;
if (vClients.size() == 0)
cout << "\t\t\t\tNo Clients Available In the System!";
else
for (clsBankClient Client : vClients)
{
PrintClientRecordLine(Client);
cout << endl;
}
cout << setw(8) << left << "" << "\n\t_______________________________________________________";
cout << "_________________________________________\n" << endl;
}
};