Ejemplo n.º 1
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            Program  app        = Program.GetInstance();
            RoomList editScreen = app.GetScreen <RoomList>("roomList");

            app.ShowScreen(editScreen);
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            Program     app         = Program.GetInstance();
            RoomService roomService = app.GetService <RoomService>("rooms");

            // Ask for confirmation
            if (!GuiHelper.ShowConfirm("Weet je zeker dat je deze zaal wilt verwijderen?"))
            {
                return;
            }

            // Delete room
            if (!roomService.DeleteRoom(room))
            {
                GuiHelper.ShowError("Kon zaal niet verwijderen");
                return;
            }

            // Redirect to screen
            RoomList newScreen = app.GetScreen <RoomList>("roomList");

            app.ShowScreen(newScreen);
            GuiHelper.ShowInfo("Zaal succesvol verwijderd");
        }