Adds backup to offsite facility command
This commit is contained in:
@@ -1332,6 +1332,9 @@ internal class Program
|
||||
* rate takes effect on the date set. For more information see the SetFutureBaseRate()
|
||||
* function.
|
||||
*
|
||||
* backup:
|
||||
* Creates a backup to be saved in an off-site storage facility.
|
||||
*
|
||||
* Q or Q:
|
||||
* Returns to the main loop for choosing either the Guest or Admin flow.
|
||||
*/
|
||||
@@ -1348,6 +1351,16 @@ internal class Program
|
||||
case "checkin guest": CheckIn(); break; // Checks a guest in and assigns a room
|
||||
case "checkout guest": CheckOut(); break; // Checks out a guest and marks their reservation as ended
|
||||
case "set rate": SetFutureBaseRate(); break; // Allows employees to configure base rates
|
||||
case "backup":
|
||||
Directory.CreateDirectory("offsite-storage");
|
||||
File.Copy("database.sqlite3", "offsite-storage\\database.sqlite3.bak", true);
|
||||
Console.WriteLine("Backup was created. Move this to offsite storage facility.");
|
||||
if (File.Exists("offsite-storage\\database.sqlite3.bak"))
|
||||
{
|
||||
FileInfo f = new("offsite-storage\\database.sqlite3.bak");
|
||||
Console.WriteLine($"Database has been backed up to {f.FullName}");
|
||||
}
|
||||
break; // Create a backup
|
||||
case "Q": return; // Quit to mode loop
|
||||
case "q": return; // Quit to mode loop
|
||||
default: Console.WriteLine("Unknown command, enter help for more inforamtion."); break;
|
||||
|
||||
Reference in New Issue
Block a user