-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnterPoint.cpp
More file actions
56 lines (53 loc) · 1.62 KB
/
EnterPoint.cpp
File metadata and controls
56 lines (53 loc) · 1.62 KB
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
#include "EnterPoint.h"
#include "Authorization.h"
#include "Contacts.h"
#include "StorageOperations.h"
#include "PremiumAndDiscounts.h"
#include "MomFriendSon.h"
#include "PaymentOperations.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
void invalid_error() {
throw std::invalid_argument("Такой операции не существует");
}
void menu(short attempt) {
Assert::IsTrue(attempt >= 10,L"Было использовано более 10 попыток при выборе опции.");
std::string option = "";
std::cout << std::right << std::setw(62) << "Возрождение май\n";
std::string menu_types[]{ "","Товары","Учетные записи","Продажи","Склад","Сын маминой подруги","Контакты","Выйти со своего аккаунта" };
for (std::size_t i = 1; i < 8; ++i) {
std::cout << "[" << i << "] " << menu_types[i] << "\n";
}
std::cout << LIGHT_BLUE << "Выберите опцию:\n" << RESET;
std::cin >> option;
switch (std::stoi(option)) {
case 1:
start(1);
break;
case 2:
accounts(1);
break;
case 3:
sales();
break;
case 4:
storage(1);
break;
case 5:
momFriendSon();
break;
case 6:
contacts();
break;
case 7:
if (client == "Покупатель") {
client.clear();
}
login(1);
break;
default:
Assert::ExpectException<std::invalid_argument>([] {
invalid_error();
});
break;
}
}