-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsMainScreen.h
181 lines (162 loc) · 4.37 KB
/
clsMainScreen.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
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
171
172
173
174
175
176
177
178
179
180
#pragma once
#include <iostream>
#include <iomanip>
#include "clsBankClient.h"
#include "clsScreen.h"
#include "clsClientsListScreen.h"
#include "clsAddNewClientsScreen.h"
#include "clsDeleteClientScreen.h"
#include "clsUpdateClientScreen.h"
#include "clsFindClientScreen.h"
#include "clsTransactionsScreen.h"
#include "clsManageUsersScreen.h"
#include "clsLoginScreen.h"
#include "clsShowLoginRegisterScreen.h"
#include "clsShowCurrencyMainScreen.h"
#include "Global.h"
using namespace std;
class clsMainScreen : protected clsScreen
{
private:
enum enMainMenueOptions
{
enShow = 1,
enAdd = 2,
enDelete = 3,
enUpdate = 4,
enFind = 5,
enTransactions = 6,
enManageUsers = 7,
enLoginRegister = 8,
enCurrencyExchange = 9,
enLogout = 10
};
static int _ReadMainMenueOption()
{
cout << setw(37) << left << "" << "Choose what do you want to do? [1 to 10]? ";
int Choice = clsInputValidate::ReadIntNumberBetween(1, 10, "Error input , Enter Number between 1 to 10 ? ");
return Choice;
}
static void _GoBackToMainMenue()
{
cout << setw(37) << left << "" << "\n\tPress any key to go back to Main Menue...\n";
system("pause>0");
ShowMainMenue();
}
static void _ShowAllClientsScreen()
{
clsClientListScreen::ShowClientsList();
}
static void _ShowAddNewClientsScreen()
{
clsAddNewClientScreen::ShowAddNewClientScreen();
}
static void _ShowDeleteClientScreen()
{
clsDeleteClientScreen::ShowDeleteClientScreen();
}
static void _ShowUpdateClientScreen()
{
clsUpdateClientScreen::ShowUpdateClientScreen();
}
static void _ShowFindClientScreen()
{
clsFindClientScreen::ShowFindClientScreen();
}
static void _ShowTransactionsMenue()
{
clsTransactionsScreen::ShowTransactionsMenue();
}
static void _ShowManageUsersMenue()
{
clsManageUsersScreen::ShowManageUsersMenue();
}
static void _ShowLoginRegisterScreen()
{
clsShowLoginRegisterScreen::ShowLoginRegisterScreen();
}
static void _ShowCurrencyMainScreen()
{
clsShowCurrencyMainScreen::ShowCurrencyMainScreen();
}
static void _Logout()
{
CurrentUser = clsUser::Find("", "");
}
static void _PerfromMainMenueOption(enMainMenueOptions MainMenueOptions)
{
switch (MainMenueOptions)
{
case clsMainScreen::enShow:
system("cls");
_ShowAllClientsScreen();
_GoBackToMainMenue();
break;
case clsMainScreen::enAdd:
system("cls");
_ShowAddNewClientsScreen();
_GoBackToMainMenue();
break;
case clsMainScreen::enDelete:
system("cls");
_ShowDeleteClientScreen();
_GoBackToMainMenue();
break;
case clsMainScreen::enUpdate:
system("cls");
_ShowUpdateClientScreen();
_GoBackToMainMenue();
break;
case clsMainScreen::enFind:
system("cls");
_ShowFindClientScreen();
_GoBackToMainMenue();
break;
case clsMainScreen::enTransactions:
system("cls");
_ShowTransactionsMenue();
_GoBackToMainMenue();
break;
case clsMainScreen::enManageUsers:
system("cls");
_ShowManageUsersMenue();
_GoBackToMainMenue();
break;
case clsMainScreen::enLoginRegister:
system("cls");
_ShowLoginRegisterScreen();
_GoBackToMainMenue();
case clsMainScreen::enCurrencyExchange:
system("cls");
_ShowCurrencyMainScreen();
_GoBackToMainMenue();
case clsMainScreen::enLogout:
system("cls");
_Logout();
break;
default:
break;
}
}
public:
static void ShowMainMenue()
{
system("cls");
_DrawScreenHeader("\t\tMain Screen");
cout << setw(37) << left << "" << "===========================================\n";
cout << setw(37) << left << "" << "\t\t\tMain Menue\n";
cout << setw(37) << left << "" << "===========================================\n";
cout << setw(37) << left << "" << "\t[1] Show Client List.\n";
cout << setw(37) << left << "" << "\t[2] Add New Client.\n";
cout << setw(37) << left << "" << "\t[3] Delete Client.\n";
cout << setw(37) << left << "" << "\t[4] Update Client Info.\n";
cout << setw(37) << left << "" << "\t[5] Find Client.\n";
cout << setw(37) << left << "" << "\t[6] Transactions.\n";
cout << setw(37) << left << "" << "\t[7] Manage Users.\n";
cout << setw(37) << left << "" << "\t[8] Login Register.\n";
cout << setw(37) << left << "" << "\t[9] Currency Exchange.\n";
cout << setw(37) << left << "" << "\t[10] Logout.\n";
cout << setw(37) << left << "" << "===========================================\n";
_PerfromMainMenueOption((enMainMenueOptions)_ReadMainMenueOption());
}
};