-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsShowCurrencyMainScreen.h
118 lines (99 loc) · 3.54 KB
/
clsShowCurrencyMainScreen.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
#pragma once
#include "clsCurrenciesListScreen.h"
#include "clsCurrenciesFindScreen.h"
#include "clsUpdateCurrencyRate.h"
#include "clsCurrencyCalculator.h"
class clsShowCurrencyMainScreen : protected clsScreen
{
private:
enum enCurrenciesMainMenueOptions {
eListCurrencies = 1, eFindCurrency = 2, eUpdateCurrencyRate = 3,
eCurrencyCalculator = 4, eMainMenue = 5
};
static short ReadCurrenciesMainMenueOptions()
{
cout << setw(37) << left << "" << "Choose what do you want to do? [1 to 5]? ";
short Choice = clsInputValidate::ReadIntNumberBetween(1, 5, "Enter Number between 1 to 5? ");
return Choice;
}
static void _GoBackToCurrenciesMenue()
{
cout << "\n\nPress any key to go back to Currencies Menue...";
system("pause>0");
ShowCurrencyMainScreen();
}
static void _ShowCurrenciesListScreen()
{
clsCurrenciesListScreen::ShowCurrenciesListScreen();
}
static void _ShowFindCurrencyScreen()
{
clsCurrenciesFindScreen::ShowFindCurrencyScreen();
}
static void _ShowUpdateCurrencyRateScreen()
{
clsUpdateCurrencyRate::ShowUpdateCurrencyRateScreen();
}
static void _ShowCurrencyCalculatorScreen()
{
clsCurrencyCalculator::ShowCurrencyCalculatorScreen();
}
static void _PerformCurrenciesMainMenueOptions(enCurrenciesMainMenueOptions CurrenciesMainMenueOptions)
{
switch (CurrenciesMainMenueOptions)
{
case enCurrenciesMainMenueOptions::eListCurrencies:
{
system("cls");
_ShowCurrenciesListScreen();
_GoBackToCurrenciesMenue();
break;
}
case enCurrenciesMainMenueOptions::eFindCurrency:
{
system("cls");
_ShowFindCurrencyScreen();
_GoBackToCurrenciesMenue();
break;
}
case enCurrenciesMainMenueOptions::eUpdateCurrencyRate:
{
system("cls");
_ShowUpdateCurrencyRateScreen();
_GoBackToCurrenciesMenue();
break;
}
case enCurrenciesMainMenueOptions::eCurrencyCalculator:
{
system("cls");
_ShowCurrencyCalculatorScreen();
_GoBackToCurrenciesMenue();
break;
}
case enCurrenciesMainMenueOptions::eMainMenue:
{
//do nothing here the main screen will handle it :-) ;
}
}
}
public:
static void ShowCurrencyMainScreen()
{
if (!CheckAccessRights(clsUser::enPermissions::pCurrencyExchange))
{
return;// this will exit the function and it will not continue
}
system("cls");
_DrawScreenHeader(" Currancy Exhange Main Screen");
cout << setw(37) << left << "" << "===========================================\n";
cout << setw(37) << left << "" << "\t\t Currency Exhange Menue\n";
cout << setw(37) << left << "" << "===========================================\n";
cout << setw(37) << left << "" << "\t[1] List Currencies.\n";
cout << setw(37) << left << "" << "\t[2] Find Currency.\n";
cout << setw(37) << left << "" << "\t[3] Update Rate.\n";
cout << setw(37) << left << "" << "\t[4] Currency Calculator.\n";
cout << setw(37) << left << "" << "\t[5] Main Menue.\n";
cout << setw(37) << left << "" << "===========================================\n";
_PerformCurrenciesMainMenueOptions((enCurrenciesMainMenueOptions)ReadCurrenciesMainMenueOptions());
}
};