-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFINALE
865 lines (717 loc) · 34.1 KB
/
FINALE
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
using System;
using System.Net;
using System.Net.Http.Headers;
using System.Reflection;
namespace HotelBookingProgram
{
class Program
{
static Dictionary<string, string> accounts = new Dictionary<string, string>();
static int currentpage = 0;
static string? address, contactNumber, emailAddress, realRoom;
static string roomchoice;
public static int age;
public static int SS = 500, MS = 800, BS = 1000, HS = 1500, PS = 2000;
public static int costperday;
public static int index = 0;
static string?[] name = new string[25];
public static string[] finalrooms = new string[25];
static bool[] rooms = new bool[20];
static string[] finalroom = new string[25];
public static int[] total = new int[25];
static int[] finaltotal = new int[25];
public static string[] paymentmeth = new string[25];
public static DateTime[] startDate = new DateTime[25];
public static DateTime[] endDate = new DateTime[25];
public static int[] adultno = new int[25];
public static int[] daysDifference = new int[25];
static string[] occupants = new string[25];
static string[] finalname = new string[25];
static string[] finalpaymentmeth = new string[25];
static int[] finaladultno = new int[25];
public static DateTime[] finalstartDate = new DateTime[25];
public static DateTime[] finalendDate = new DateTime[25];
static int[] finaldaysDifference = new int[25];
public static void Main(string[] args)
{
char retry;
do
{
index++;
Welcome();
homepage();
Welcome();
Basicinfo();
RoomType();
DateAndCost();
Incompletebookingdetails();
confirmation();
Console.Write("Do you want to book another room? (y/n): ");
retry = char.Parse(Console.ReadLine());
} while (retry == 'y' || retry == 'Y');
if (retry != 'n')
{
showguidelines();
}
}
static void Welcome()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("*************************************************");
Console.WriteLine("* *");
Console.WriteLine("* Welcome to Morada Grand Royal Hotel! *");
Console.WriteLine("* *");
Console.WriteLine("*************************************************");
Console.ResetColor();
Console.ReadKey();
}
static void homepage()
{
Console.Clear();
Console.WriteLine("How can we help you?");
bool validChoice = false;
Console.WriteLine("\n\n***********************");
Console.WriteLine("Navigation Options:");
Console.WriteLine("1. Login (Create your account first)");
Console.WriteLine("2. Sign Up");
Console.WriteLine("***********************");
Console.Write("What do you want to do: ");
while (!validChoice)
{
if (int.TryParse(Console.ReadLine(), out int homeChoice))
{
switch (homeChoice)
{
case 1:
LoginProcess();
validChoice = true;
break;
case 2:
SignUp();
validChoice = true;
break;
default:
Console.WriteLine("Invalid choice. Please enter 1 or 2.");
break;
}
}
else
{
Console.Write("Invalid input. Please enter a number: ");
}
}
Console.ReadKey();
}
static void SignUp()
{
Console.Clear();
Console.WriteLine("Welcome! Let's create an account.");
while (true)
{
Console.Write("Please enter your age: ");
if (int.TryParse(Console.ReadLine(), out int age))
{
if (age >= 18)
{
Console.WriteLine("You are eligible to create an account.");
break; // Exit the loop when the input is valid
}
else
{
Console.WriteLine("You must be 18 years or older to create an account.");
Console.ReadKey();
homepage();
break; // Exit the loop after displaying the message
}
}
else
{
Console.WriteLine("Invalid input. Please enter a valid age.");
}
}
Console.Write("Please enter a new username: ");
string newUsername = Console.ReadLine();
while (string.IsNullOrEmpty(newUsername)) // Ensures the username is not empty
{
Console.WriteLine("Username cannot be empty. Please enter a valid username: ");
newUsername = Console.ReadLine();
}
Console.Write("Please enter a password: ");
string newPassword = Console.ReadLine();
while (string.IsNullOrEmpty(newPassword)) // Ensures the password is not empty
{
Console.WriteLine("Password cannot be empty. Please enter a valid password:");
newPassword = Console.ReadLine();
}
AddAccount(newUsername, newPassword);
Console.WriteLine("Account created successfully!");
Console.WriteLine("Enter to go back to the Home Page and Login to your account to book a hotel");
Console.ReadKey();
homepage();
}
static void AddAccount(string username, string password)
{
if (!accounts.ContainsKey(username))
{
accounts.Add(username, password);
}
else
{
Console.WriteLine("Account already exists. Please choose a different username.");
SignUp();
}
}
static void LoginProcess()
{
Console.Clear();
Console.WriteLine("\nPlease login to your account.");
Console.Write("Enter your username: ");
string enteredUsername = Console.ReadLine();
Console.Write("Enter your password: ");
string enteredPassword = Console.ReadLine();
if (Login(enteredUsername, enteredPassword))
{
Console.WriteLine("Login successful!");
Console.WriteLine("Enter to book a hotel now");
}
else
{
Console.WriteLine("Invalid username or password. We will now redirect you to the Home page.");
Console.ReadKey();
homepage();
}
}
static bool Login(string username, string password)
{
return accounts.ContainsKey(username) && accounts[username] == password;
}
static void Basicinfo()
{
Console.Clear();
bool validInput1 = false;
bool validInput2 = false;
bool validInput3 = false;
do
{
try
{
Console.Write("Please enter your name: ");
name[index - 1] = Console.ReadLine();
if (name[index - 1].Any(Char.IsDigit))
{
throw new ArgumentException("Name should not contain numbers.");
}
else if (string.IsNullOrWhiteSpace(name[index - 1]))
{
throw new ArgumentException("Name should not be empty or whitespace.");
}
else
{
validInput1 = true;
}
}
catch (ArgumentException ex)
{
Console.WriteLine("Invalid input: " + ex.Message);
}
} while (!validInput1);
do
{
try
{
Console.Write("Please enter your contact number: ");
contactNumber = Console.ReadLine();
if (contactNumber.Any(char.IsLetter))
{
throw new ArgumentException("Contack Number should not contain letters.");
}
else if (string.IsNullOrWhiteSpace(contactNumber))
{
throw new ArgumentException("contact number should not be empty or whitespace.");
}
else
{
validInput2 = true;
}
}
catch (ArgumentException ex)
{
Console.WriteLine("Invalid input: " + ex.Message);
}
} while (!validInput2);
do
{
try
{
Console.Write("Please enter your email address: ");
emailAddress = Console.ReadLine();
if (string.IsNullOrWhiteSpace(emailAddress))
{
throw new ArgumentException("Email address should not be empty or whitespace.");
}
else
{
validInput3 = true;
}
}
catch (ArgumentException ex)
{
Console.WriteLine("Invalid input: " + ex.Message);
}
} while (!validInput3);
}
static void RoomType()
{
Console.Clear();
Console.WriteLine();
Console.WriteLine("******************************************");
Console.WriteLine("* Guest and Room *");
Console.WriteLine("******************************************");
Console.WriteLine();
bool validroom = false;
bool validinput = false;
do
{
try
{
Console.WriteLine("Our hotel have a min/max occupants of 1 to 5");
Console.Write("Enter the number of occupants: ");
occupants[index - 1] = Console.ReadLine();
if (string.IsNullOrWhiteSpace(occupants[index - 1]))
{
throw new ArgumentException("Input cannot be blank.");
}
adultno[index - 1] = int.Parse(occupants[index - 1]);
if (adultno[index - 1] < 1 || adultno[index - 1] > 5)
{
throw new ArgumentOutOfRangeException();
}
validinput = true;
}
catch (ArgumentException ex)
{
Console.WriteLine("Invalid input: " + ex.Message);
}
catch (FormatException)
{
Console.WriteLine("Invalid input. Please enter a valid number.");
}
} while (!validinput);
while (true)
{
Console.WriteLine("You entered: " + adultno[index - 1] + " occupants");
Console.ReadLine();
Console.Clear();
if (adultno[index - 1] == 1)
{
Console.WriteLine();
Console.WriteLine("Here are our offers : \nSS1, SS2, SS3, SS4, SS5 \n Standard Suites (500 php per head for 24hrs)");
Console.WriteLine("It includes : \n A living area \n A bedroom with queen-sized bed \n A bathroom with a shower");
Console.WriteLine();
Console.WriteLine("MS1, MS2, MS3, MS4, MS5 \n Mini Suite (800 php per head for 24hrs)");
Console.WriteLine("Separate living area \n A bedroom with king-sized bed \n A spacious bathroom with a bathtub and shower \n Work desk \n High-speed internet \n Flat screen TV \n");
Console.WriteLine();
Console.WriteLine("BS1, BS2, BS3, BS4, BS5 \n Bridal Suites (1000 php per head for 24hrs)");
Console.WriteLine("Romantic ambiance with a king-sized bed \n A spacious bathroom with a Jacuzzi tub \n A separate living area \n Champagne \n Chocolates \n Other romantic touches");
Console.WriteLine();
Console.WriteLine("HS1, HS2, HS3, HS4, HS5 \n Honeymoon Suite (1500 php per head for 24hrs)");
Console.WriteLine("Four-poster bed \n A private balcony with a view \n A spacious bathroom with a Jacuzzi tub \n Bottle of champagne \n Rose petals \n Other romantic amenities \n ");
Console.WriteLine();
Console.WriteLine(" SS1 to SS5 = Standard Suites \n MS1 to MS5 = Mini Suite \n BS1 to BS5 = Bridal Suites \n HS1 to HS5 = Honeymoon Suite");
}
else if (adultno[index - 1] <= 3)
{
Console.WriteLine();
Console.WriteLine("Here are our available rooms:");
Console.WriteLine();
Console.WriteLine("MS1, MS2, MS3, MS4, MS5 \n Mini Suite (800 php per head for 24hrs)");
Console.WriteLine("Separate living area \n A bedroom with king-sized bed \n A spacious bathroom with a bathtub and shower \n Work desk \n High-speed internet \n Flat screen TV \n");
Console.WriteLine();
Console.WriteLine("BS1, BS2, BS3, BS4, BS5 \n Bridal Suites (1000 php per head for 24hrs)");
Console.WriteLine("Romantic ambiance with a king-sized bed \n A spacious bathroom with a Jacuzzi tub \n A separate living area \n Champagne \n Chocolates \n Other romantic touches");
Console.WriteLine();
Console.WriteLine("HS1, HS2, HS3, HS4, HS5 \n Honeymoon Suite (1500 php per head for 24hrs)");
Console.WriteLine("Four-poster bed \n A private balcony with a view \n A spacious bathroom with a Jacuzzi tub \n Bottle of champagne \n Rose petals \n Other romantic amenities \n ");
Console.WriteLine();
Console.WriteLine(" MS1 to MS5 = Mini Suite \n BS1 to BS5 = Bridal Suites \n HS1 to HS5 = Honeymoon Suite");
}
else if (adultno[index - 1] <= 4)
{
Console.WriteLine();
Console.WriteLine("Here are our available rooms:");
Console.WriteLine();
Console.WriteLine("BS1, BS2, BS3, BS4, BS5 \n Bridal Suites (1000 php per head for 24hrs)");
Console.WriteLine("Romantic ambiance with a king-sized bed \n A spacious bathroom with a Jacuzzi tub \n A separate living area \n Champagne \n Chocolates \n Other romantic touches");
Console.WriteLine();
Console.WriteLine("HS1, HS2, HS3, HS4, HS5 \n Honeymoon Suite (1500 php per head for 24hrs)");
Console.WriteLine("Four-poster bed \n A private balcony with a view \n A spacious bathroom with a Jacuzzi tub \n Bottle of champagne \n Rose petals \n Other romantic amenities \n ");
Console.WriteLine();
Console.WriteLine(" BS1 to BS5 = Bridal Suites \n HS1 to HS5 = Honeymoon Suite");
}
else if (adultno[index - 1] <= 5)
{
Console.WriteLine();
Console.WriteLine("Here are our available rooms:");
Console.WriteLine();
Console.WriteLine("HS1, HS2, HS3, HS4, HS5 \n Honeymoon Suite (1500 php per head for 24hrs)");
Console.WriteLine("Four-poster bed \n A private balcony with a view \n A spacious bathroom with a Jacuzzi tub \n Bottle of champagne \n Rose petals \n Other romantic amenities \n ");
Console.WriteLine();
Console.WriteLine(" HS1 to HS5 = Honeymoon Suite");
Console.WriteLine();
}
Console.Write("Enter the code of the room that you choose: ");
roomchoice = Console.ReadLine().ToUpper();
switch (roomchoice)
{
case "SS1":
Console.WriteLine("You selected Standard Suite room number 1.");
ReserveRoom(0, "Standard Suite room number 1");
costperday = SS;
validroom = true;
break;
case "MS1":
Console.WriteLine("You selected Mini Suite room number 1.");
ReserveRoom(1, "Mini Suite room number 1");
costperday = MS;
validroom = true;
break;
case "BS1":
Console.WriteLine("You selected Bridal Suites room number 1.");
ReserveRoom(2, "Bridal Suite room number 1");
costperday = BS;
validroom = true;
break;
case "HS1":
Console.WriteLine("You selected Honeymoon Suite room number 1.");
ReserveRoom(3, "Honeymoon Suite room number 1");
costperday = HS;
validroom = true;
break;
case "SS2":
Console.WriteLine("You selected Standard Suite room number 2.");
ReserveRoom(4, "Standard Suite room number 2");
costperday = SS;
validroom = true;
break;
case "MS2":
Console.WriteLine("You selected Mini Suite room number 2.");
ReserveRoom(5, "Mini Suite room number 2");
costperday = MS;
validroom = true;
break;
case "BS2":
Console.WriteLine("You selected Bridal Suites room number 2.");
ReserveRoom(6, "Bridal Suite room number 2");
costperday = BS;
validroom = true;
break;
case "HS2":
Console.WriteLine("You selected Honeymoon Suite room number 2.");
ReserveRoom(7, "Honeymoon Suite room number 2");
costperday = HS;
validroom = true;
break;
case "SS3":
Console.WriteLine("You selected Standard Suite room number 3.");
ReserveRoom(8, "Standard Suite room number 3");
costperday = SS;
validroom = true;
break;
case "MS3":
Console.WriteLine("You selected Mini Suite room number 3.");
ReserveRoom(9, "Mini Suite room number 3");
costperday = MS;
validroom = true;
break;
case "BS3":
Console.WriteLine("You selected Bridal Suites room number 3.");
ReserveRoom(10, "Bridal Suite room number 3");
costperday = BS;
validroom = true;
break;
case "HS3":
Console.WriteLine("You selected Honeymoon Suite room number 3.");
ReserveRoom(11, "Honeymoon Suite room number 3");
costperday = HS;
validroom = true;
break;
case "SS4":
Console.WriteLine("You selected Standard Suite room number 4");
ReserveRoom(12, "Standard Suite room number 4");
costperday = SS;
validroom = true;
break;
case "MS4":
Console.WriteLine("You selected Mini Suite room number 4.");
ReserveRoom(13, "Mini Suite room number 4");
costperday = MS;
validroom = true;
break;
case "BS4":
Console.WriteLine("You selected Bridal Suites room number 4.");
ReserveRoom(14, "Bridal Suite room number 4");
costperday = BS;
validroom = true;
break;
case "HS4":
Console.WriteLine("You selected Honeymoon Suite room number 4.");
ReserveRoom(15, "Honeymoon Suite room number 4");
costperday = HS;
validroom = true;
break;
case "SS5":
Console.WriteLine("You selected Standard Suite room number 5");
ReserveRoom(16, "Standard Suite room number 5");
costperday = SS;
validroom = true;
break;
case "MS5":
Console.WriteLine("You selected Mini Suite room number 5.");
ReserveRoom(17, "Mini Suite room number 5");
costperday = MS;
validroom = true;
break;
case "BS5":
Console.WriteLine("You selected Bridal Suites room number 5.");
ReserveRoom(18, "Bridal Suite room number 5");
costperday = BS;
validroom = true;
break;
case "HS5":
Console.WriteLine("You selected Honeymoon Suite room number 5.");
ReserveRoom(19, "Honeymoon Suite room number 5");
costperday = HS;
validroom = true;
break;
default:
Console.WriteLine("Wrong code, please only enter the available code");
break;
}
Console.ReadLine();
break;
}
}
static void ReserveRoom(int roomIndex, string roomType)
{
if (rooms[roomIndex])
{
Console.WriteLine($"The {roomType} room is already reserved. Please choose another room.");
Console.ReadLine();
RoomType();
}
else
{
rooms[roomIndex] = true;
Console.WriteLine($"The {roomType} room has been reserved successfully!");
Console.ReadLine();
}
}
static void DateAndCost()
{
Console.Clear();
Console.WriteLine();
Console.WriteLine("******************************************");
Console.WriteLine("* Date of Stay *");
Console.WriteLine("******************************************");
Console.Write("Check-in date (yyyy-MM-dd): ");
startDate[index - 1] = GetValidDateInput();
Console.Write("Check-out date (yyyy-MM-dd): ");
endDate[index - 1] = GetValidDateInput();
daysDifference[index - 1] = (int)(endDate[index - 1] - startDate[index - 1]).TotalDays;
Console.WriteLine($"You will be staying for {daysDifference[index - 1]} days.");
total[index - 1] = adultno[index - 1] * (daysDifference[index - 1] * costperday);
Console.WriteLine($"The total cost for {roomchoice} with {daysDifference[index - 1]} number of days and {adultno[index - 1]} residents is : P" + total[index - 1]);
Console.ReadKey();
}
static void checkin()
{
Console.Clear();
Console.WriteLine();
Console.WriteLine("******************************************");
Console.WriteLine("* Date of Stay *");
Console.WriteLine("******************************************");
Console.Write("Check-in date (yyyy-MM-dd): ");
DateTime startDate = GetValidDateInput();
Console.Write("Check-out date (yyyy-MM-dd): ");
DateTime endDate = GetValidDateInput();
int daysDifference = (int)(endDate - startDate).TotalDays;
Console.WriteLine($"You will be staying for {daysDifference} days.");
Console.ReadKey();
}
static DateTime GetValidDateInput()
{
DateTime date;
string input;
do
{
Console.Write("Enter a valid date (yyyy-MM-dd): ");
input = Console.ReadLine();
if (!DateTime.TryParseExact(input, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out date))
{
Console.WriteLine("Invalid input. Please enter a valid date in the format yyyy-MM-dd.");
}
} while (date == DateTime.MinValue);
return date;
}
static void Incompletebookingdetails()
{
Console.Clear();
finalroom[index - 1] = roomchoice;
Console.WriteLine("");
Console.WriteLine("Booking Details : "); ;
Console.WriteLine("Name: " + name[index - 1]);
Console.WriteLine("Check-in Date: " + startDate[index - 1]);
Console.WriteLine("Check-out Date: " + endDate[index - 1]);
Console.WriteLine("Days to stay: " + daysDifference[index - 1]);
Console.WriteLine("Room Choice: " + roomchoice);
Console.WriteLine("Residents: " + adultno[index - 1]);
Console.WriteLine("Total Cost: " + total[index - 1]);
Console.WriteLine("");
}
static void confirmation()
{
bool validChoice = false;
Console.WriteLine("\n\n\nDoes your Booking Information are Correct?");
Console.WriteLine("1. Yes - Proceed to Payment");
Console.WriteLine("2. No - Book again");
Console.Write("Select number to proceed: ");
while (!validChoice)
{
if (int.TryParse(Console.ReadLine(), out int homeChoice))
{
switch (homeChoice)
{
case 1:
Payment();
validChoice = true;
finalbookingdetails();
break;
case 2:
Welcome();
validChoice = true;
break;
default:
Console.WriteLine("Invalid choice. Please enter 1 or 2.");
break;
}
}
else
{
Console.Write("Invalid input. Please enter a number: ");
}
}
}
static string paymentMethod()
{
Console.Clear();
Console.WriteLine("1. Card");
Console.WriteLine("2. Gcash");
Console.WriteLine("3. Paypal");
Console.Write("Select Payment Method: ");
int choice = int.Parse(Console.ReadLine());
do
{
Console.Write("Enter the number of your payment method choice: ");
}
while (choice < 1 || choice > 3);
switch (choice)
{
case 1:
return "Card";
case 2:
return "Gcash";
case 3:
return "Paypal";
default:
return string.Empty;
}
}
static void Payment()
{
paymentmeth[index - 1] = paymentMethod();
if (paymentmeth[index - 1] == "Card")
{
Cardpayment(total[index - 1]);
}
else if (paymentmeth[index - 1] == "Gcash")
{
gcashpayment(total[index - 1]);
}
else if (paymentmeth[index - 1] == "Paypal")
{
Paypalpayment(total[index - 1]);
}
}
static void Cardpayment(double total)
{
Console.Clear();
Console.WriteLine("Payment Details: ");
Console.Write("Enter your MPIN: ");
string creditcardnumber = Console.ReadLine();
Console.WriteLine($"Credit Card successful! Total amount charged: P{total:F2}\n");
Console.ReadKey();
}
static void Paypalpayment(double total)
{
Console.Clear();
Console.WriteLine("Payment Details:");
Console.Write("Enter your PayPal email address: ");
string paypalEmail = Console.ReadLine();
Console.WriteLine($"PayPal Payment successful! Total amount charged: P{total:F2}\n");
Console.ReadKey();
}
static void gcashpayment(double total)
{
Console.Clear();
Console.WriteLine("Payment Details:");
Console.Write("Enter your name: ");
string gcashname = Console.ReadLine();
Console.Write("\nEnter your GCash mobile number: ");
string gcashNumber = Console.ReadLine();
Console.WriteLine($"GCash Payment successful! Total amount charged: P{total:F2}\n");
Console.ReadKey();
}
static void finalbookingdetails()
{
Console.Clear();
for (int i = 0; i < index; i++)
{
finalname[index - 1] = name[index - 1];
finalstartDate[index - 1] = startDate[index - 1];
finalendDate[index - 1] = endDate[index - 1];
finaldaysDifference[index - 1] = daysDifference[index - 1];
finalroom[index - 1] = roomchoice;
finaladultno[index - 1] = adultno[index - 1];
finaltotal[index - 1] = total[index - 1];
finalpaymentmeth[index - 1] = paymentmeth[index - 1];
Console.WriteLine("");
Console.WriteLine("Booking Details : Complete/Incomplete");
Console.WriteLine($"Book #{i + 1} : ");
Console.WriteLine("Name: " + finalname[i]);
Console.WriteLine("Check-in Date: " + finalstartDate[i]);
Console.WriteLine("Check-out Date: " + finalendDate[i]);
Console.WriteLine("Days to stay: " + finaldaysDifference[i]);
Console.WriteLine("Room Choice: " + finalroom[i]);
Console.WriteLine("Residents: " + finaladultno[i]);
Console.WriteLine("Total Cost: " + finaltotal[i]);
Console.WriteLine("Payment method: " + finalpaymentmeth[i]);
Console.WriteLine("");
}
}
static void showguidelines()
{
Console.Clear();
Console.WriteLine("\nHere are some guidelines to make your stay enjoyable:");
Console.WriteLine("\n- The tariff is for the room only and is exclusive of any government taxes applicable Meals and other services are available at extra cost. To know your room tariff, please contact the Duty Manager, guest registration forms must be signed on arrivals.");
Console.WriteLine("- Bills must be settled on presentation, personal cheques are not accepted..");
Console.WriteLine("- You can only bring 2 children per room.");
Console.WriteLine("- In the case of default in the payment of dues by a guest, the management shall have the linen on their luggage and belongings, and be entitled to detain the same and to sell or auction such property at any time without reference to the guest. The net sale proceeds will be appropriate towards the amount due by the guest without prejudice to the management's rights to adopt such further recovery proceedings as my be required.");
Console.WriteLine("- Please present your ID card, Passport or Temporary Residence Card upon Check-in. By Law visitors must present personal documents for hotel records. These documents will be returned upon departure.");
Console.WriteLine("- Check out time is ( mention your checkout time here ) please inform the reception if you wish to retain your room beyond this time. The extension will be given depending on the availability. If the room is available, the normal tariff will be charged. On failure of the guest to vacate the room on expiry or period the management shall have the right to remove the guest and his/her belongings from the room occupied by the Guest.");
Console.WriteLine("- Subject to availability of the storage space, the guest can store luggage in the luggage room, at the guest's sole risk as to loss or damage from any cause, Luggage may not be stored for a period of over 30 days.");
Console.WriteLine("\nThank you for choosing Morada Grand Royal Hotel, have a nice stay!\n");
Console.ReadKey();
}
}
}