Website Summary Files Commits Branches @commit @diff @stats
path: root / src / UserInterface / VenueConsoleUI.cpp
diff options
context:
space:
mode:
Commit7ebafd399b62e7138a358cb062767f47f0d03a31 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 21:14:38 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 21:14:38 +0300
Files06bfbbb3917489cfc250a0dd0761acc105d91e50 /src/UserInterface/VenueConsoleUI.cpp
FMI-OOP-P1_TicketSystem-7ebafd399b62e7138a358cb062767f47f0d03a31.tar
FMI-OOP-P1_TicketSystem-7ebafd399b62e7138a358cb062767f47f0d03a31.tar.gz
FMI-OOP-P1_TicketSystem-7ebafd399b62e7138a358cb062767f47f0d03a31.zip
Parentb1a5dab44e70642e3bb43dacfa6968afa01e0a09 (diff)
Autocommit at 07.05.2022 @ 21:14
1 files changed, 27 insertions, 0 deletions
-rw-r--r--src/UserInterface/VenueConsoleUI.cpp27
diff --git a/src/UserInterface/VenueConsoleUI.cpp b/src/UserInterface/VenueConsoleUI.cpp
index 062a4fb..8a1b18f 100644
--- a/src/UserInterface/VenueConsoleUI.cpp
+++ b/src/UserInterface/VenueConsoleUI.cpp
@@ -185,6 +185,31 @@ void submenu_reportManagement() {
/* Main */
+void load() {
+ StatusCode s = es->load();
+ if (s == E_FileCouldNotBeOpened) {
+ errorBox("Could not load events from file!");
+ pressEnterToContinue();
+ }
+ s = hs->load();
+ if (s == E_FileCouldNotBeOpened) {
+ errorBox("Could not load halls from file!");
+ pressEnterToContinue();
+ }
+}
+
+void save() {
+ StatusCode s = es->save();
+ if (s == E_FileCouldNotBeOpened) {
+ errorBox("Could not save events to file!");
+ pressEnterToContinue();
+ }
+ s = hs->save();
+ if (s == E_FileCouldNotBeOpened) {
+ errorBox("Could not save halls to file!");
+ pressEnterToContinue();
+ }
+}
void init() {
mainMenu.addCommand(Command("Ticket Management", submenu_ticketManagement));
@@ -208,6 +233,8 @@ void init() {
void runUI(EventService* eventService, HallService* hallService) {
es = eventService;
hs = hallService;
+ load();
init();
mainMenu.navigate();
+ save();
}