-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsTotalBalancesScreen.h
60 lines (44 loc) · 2.01 KB
/
clsTotalBalancesScreen.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
#pragma once
#include <iostream>
#include "clsScreen.h"
#include "clsBankClient.h"
#include <iomanip>
#include "clsUtility.h"
class clsTotalBalancesScreen : protected clsScreen
{
private:
static void PrintClientRecordBalanceLine(clsBankClient Client)
{
cout << setw(25) << left << "" << "| " << setw(15) << left << Client.GetAccountNumber();
cout << "| " << setw(40) << left << Client.FullName();
cout << "| " << setw(12) << left << Client.AccountBalance;
}
public:
static void ShowTotalBalances()
{
vector <clsBankClient> vClients = clsBankClient::GetClientsList();
string Title = "\t Balances List Screen";
string SubTitle = "\t (" + to_string(vClients.size()) + ") Client(s).";
_DrawScreenHeader(Title, SubTitle);
cout << setw(25) << left << "" << "\n\t\t_______________________________________________________";
cout << "__________________________\n" << endl;
cout << setw(25) << left << "" << "| " << left << setw(15) << "Accout Number";
cout << "| " << left << setw(40) << "Client Name";
cout << "| " << left << setw(12) << "Balance";
cout << setw(25) << left << "" << "\t\t_______________________________________________________";
cout << "__________________________\n" << endl;
double TotalBalances = clsBankClient::GetTotalBalances();
if (vClients.size() == 0)
cout << "\t\t\t\tNo Clients Available In the System!";
else
for (clsBankClient Client : vClients)
{
PrintClientRecordBalanceLine(Client);
cout << endl;
}
cout << setw(25) << left << "" << "\n\t\t_______________________________________________________";
cout << "__________________________\n" << endl;
cout << setw(8) << left << "" << "\t\t\t\t\t\t\t Total Balances = " << TotalBalances << endl;
cout << setw(8) << left << "" << "\t\t\t\t ( " << clsUtil::NumberToText(TotalBalances) << ")";
}
};