-
Notifications
You must be signed in to change notification settings - Fork 0
/
clsAddClientScreen.cpp
39 lines (36 loc) · 1.06 KB
/
clsAddClientScreen.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
#include "clsAddClientScreen.h"
void clsAddClientScreen::AddClient()
{
string AddMore = "";
do
{
system("cls");
clsScreen::_DrawScreenHeader("Add New Client");
string AccountNumber = clsInputValidate::ReadString("Enter Account Number : ");
bool IsClientExisit = clsClient::IsClientExisits(AccountNumber);
while (IsClientExisit)
{
cout << "Account Number Is Already Taken! Enter Another one.\n";
AccountNumber = clsInputValidate::ReadString("Enter Account Number : ");
IsClientExisit = clsClient::IsClientExisits(AccountNumber);
}
clsClient NewClient = clsClient::GetAddNewClientObject(AccountNumber);
ReadClientInfo(NewClient);
clsClient::enSaveResult SaveResult = NewClient.Save();
system("cls");
switch (SaveResult)
{
case clsClient::svSuccess:
cout << "Client Added Successfully.\n";
clsScreen::PrintClient(NewClient);
cout << "\nDo You Want To Add More (yes,no) ? \n";
cin >> AddMore;
break;
case clsClient::svFailed:
cout << "\nError Save!\n";
break;
default:
break;
}
} while (tolower(AddMore[0])=='y');
}