-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsDepositScreen.h
79 lines (59 loc) · 2 KB
/
clsDepositScreen.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
#pragma once
#include <iostream>
#include "clsScreen.h"
#include "clsBankClient.h"
#include "clsInputValidate.h"
class clsDepositScreen : protected clsScreen
{
private:
static void _PrintClient(clsBankClient Client)
{
cout << "\nClient Card:";
cout << "\n___________________";
cout << "\nFirstName : " << Client.FirstName;
cout << "\nLastName : " << Client.LastName;
cout << "\nFull Name : " << Client.FullName();
cout << "\nEmail : " << Client.Email;
cout << "\nPhone : " << Client.Phone;
cout << "\nAcc. Number : " << Client.AccountNumber();
cout << "\nPassword : " << Client.PinCode;
cout << "\nBalance : " << Client.AccountBalance;
cout << "\n___________________\n";
}
static string _ReadAccountNumber()
{
string AccountNumber = "";
cout << "\nPlease enter AccountNumber? ";
cin >> AccountNumber;
return AccountNumber;
}
public:
static void ShowDepositScreen()
{
_DrawScreenHeader("\t Deposit Screen");
string AccountNumber = _ReadAccountNumber();
while (!clsBankClient::IsClientExist(AccountNumber))
{
cout << "\nClient with [" << AccountNumber << "] does not exist.\n";
AccountNumber = _ReadAccountNumber();
}
clsBankClient Client1 = clsBankClient::Find(AccountNumber);
_PrintClient(Client1);
double Amount = 0;
cout << "\nPlease enter deposit amount? ";
Amount = clsInputValidate::ReadDblNumber();
cout << "\nAre you sure you want to perform this transaction? ";
char Answer = 'n';
cin >> Answer;
if (Answer == 'Y' || Answer == 'y')
{
Client1.Deposit(Amount);
cout << "\nAmount Deposited Successfully.\n";
cout << "\nNew Balance Is: " << Client1.AccountBalance;
}
else
{
cout << "\nOperation was cancelled.\n";
}
}
};