From 7ebafd399b62e7138a358cb062767f47f0d03a31 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 May 2022 21:14:38 +0300 Subject: Autocommit at 07.05.2022 @ 21:14 --- src/UserInterface/VenueConsoleUI.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/UserInterface/VenueConsoleUI.cpp') 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(); } -- cgit v1.3.1-23-gd82d