-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cs
55 lines (52 loc) · 1.22 KB
/
Main.cs
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
namespace Program
{
class Program
{
static void Main(string[] args)
{
HotelSystem hotelSystem = new HotelSystem();
bool exit = false;
while (!exit)
{
Console.WriteLine("Welcome to our hotel self-service system...");
Console.WriteLine("Please select a number to complete \n\n" +
"[1] Log-in as Guest\n" +
"[2] Log-in as Manager\n" +
"[3] Sign-in as new Guest\n" +
"[4] Exit");
Console.Write("Enter your choice : ");
int KindofUser = Convert.ToInt32(Console.ReadLine());
switch (KindofUser)
{
case 1:
Guest loggedInGuest = hotelSystem.LoginG();
if (loggedInGuest != null)
{
loggedInGuest.GuestFunctions(loggedInGuest);
hotelSystem.LogoutG();
}
break;
case 2:
bool isManagerLoggedIn = hotelSystem.LoginM();
if (isManagerLoggedIn)
{
Manager manager = new Manager();
manager.ManagerFunctions();
hotelSystem.LogoutM();
}
break;
case 3:
hotelSystem.NewUser();
break;
case 4:
exit = true;
hotelSystem.Exit();
break;
default:
Console.WriteLine("Invalid choice, please try again.");
break;
}
}
}
}
}