-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclsTotalBalancesScreen.cpp
41 lines (33 loc) · 1.45 KB
/
clsTotalBalancesScreen.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
#include "clsTotalBalancesScreen.h"
void clsTotalBalancesScreen::PrintClientRecordBalanceLine(clsClient Client)
{
cout << "| " << setw(15) << left << Client.account_number;
cout << "| " << setw(40) << left << Client.fullname;
cout << "| " << setw(12) << left << Client.balance;
}
void clsTotalBalancesScreen::ShowTotalBalances()
{
clsScreen::_DrawScreenHeader("Total Balances!");
vector <clsClient> vClients = clsClient::GetClientsList();
cout << "\n\t\t\t\t\tBalances List (" << vClients.size() << ") Client(s).";
cout << "\n_______________________________________________________";
cout << "_________________________________________\n" << endl;
cout << "| " << left << setw(15) << "Accout Number";
cout << "| " << left << setw(40) << "Client Name";
cout << "| " << left << setw(12) << "Balance";
cout << "\n_______________________________________________________";
cout << "_________________________________________\n" << endl;
double TotalBalances = clsClient::GetTotalBalances();
if (vClients.size() == 0)
cout << "\t\t\t\tNo Clients Available In the System!";
else
for (clsClient& Client : vClients)
{
PrintClientRecordBalanceLine(Client);
cout << endl;
}
cout << "\n_______________________________________________________";
cout << "_________________________________________\n" << endl;
cout << "\t\t\t\t\t Total Balances = " << TotalBalances << endl;
cout << "\t\t\t\t\t ( " << clsUtil::NumberToText(TotalBalances) << ")\n\n";
}