Added issue penalties function
This commit adds another piece of functinality allowing the staff to issue penalties. This currently just charges users for their owed amount and there are no actual penalty fees. The design document did not call for that. There is also some documentation that was written. The next several set of commits are likely to be documentation.
This commit is contained in:
@@ -993,6 +993,15 @@ internal class Program
|
||||
Console.WriteLine($"Daily occupancy has been written and appended to {f.FullName}");
|
||||
}
|
||||
}
|
||||
void IssuePenalties()
|
||||
{
|
||||
List<Reservation> reservations = Hotel.GetPastDueReservations();
|
||||
foreach (Reservation reservation in reservations)
|
||||
{
|
||||
reservation.CancelReservation();
|
||||
}
|
||||
Console.WriteLine("Penalties have been issued.");
|
||||
}
|
||||
|
||||
Console.Write(
|
||||
"\nWelcome to the Ophelias Oasis Hotel Management System!\n" +
|
||||
@@ -1009,7 +1018,7 @@ internal class Program
|
||||
case "generate operational report": GenerateOperationalReports(); break;
|
||||
case "generate accommodation bills": GenerateAccommodationBills(); break;
|
||||
case "notify pending payments": NotifyOutstandingPayments(); break;
|
||||
case "issue penalties": break;
|
||||
case "issue penalties": IssuePenalties(); break;
|
||||
case "checkin guest": CheckIn(); break;
|
||||
case "checkout guest": CheckOut(); break;
|
||||
case "set rate": SetFutureBaseRate(); break;
|
||||
@@ -1026,34 +1035,41 @@ internal class Program
|
||||
{
|
||||
if (!File.Exists("database.sqlite3") || new FileInfo("database.sqlite3").Length == 0)
|
||||
{
|
||||
/*
|
||||
* Checks to see if the databse is created. If the database file is missing, that means
|
||||
* it has not been initialized. Upon the initialization process, the tables are created
|
||||
* and the rooms table is populated with 45 rooms. This is a preconfigured value within
|
||||
* the InitializeRoomsTable() function since there was no requirement to make this configurable.
|
||||
*/
|
||||
SQLiteConnection.CreateFile("database.sqlite3");
|
||||
using (Database Manager = new())
|
||||
{
|
||||
Manager.InitializeTables();
|
||||
Manager.InitializeRoomsTable();
|
||||
}
|
||||
using Database Manager = new();
|
||||
Manager.InitializeTables();
|
||||
Manager.InitializeRoomsTable();
|
||||
}
|
||||
if (!Hotel.CheckBaseRate())
|
||||
{
|
||||
// Checks to see if the base rate is configured, if not a warning will be shown.
|
||||
Console.WriteLine("No base rate is configured. As a result reservations cannot be made until one is configured.");
|
||||
}
|
||||
|
||||
bool run = true;
|
||||
while (run)
|
||||
{
|
||||
// Main loop for checking if the person is a customer or employee.
|
||||
Console.Write(
|
||||
"Are you an employee or customer?\n" +
|
||||
"1. Employee\n" +
|
||||
"2. Customer/ Guest\n" +
|
||||
": "
|
||||
);
|
||||
switch (Console.ReadLine().ToUpper())
|
||||
switch (Console.ReadLine().ToUpper()) // Using .ToUpper() to support "q" without having to write a case for it.
|
||||
{
|
||||
case "1": AdminMode(); break;
|
||||
case "2": GuestMode(); break;
|
||||
case "Q": run = false; break;
|
||||
case "1": AdminMode(); break; // Enter employee (administrative) mode
|
||||
case "2": GuestMode(); break; // Enter guest (customer) mode
|
||||
case "Q": run = false; break; // Quit
|
||||
default: Console.WriteLine("You must either specify 1 for Employee, 2 for Customer/ Guest, or Q to quit.\n\n"); break;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("Shutting system down.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user