private void SaveButton_Click(object sender, System.EventArgs e) { Program app = Program.GetInstance(); ShowService showService = app.GetService <ShowService>("shows"); // Parse values Movie movie = (Movie)movieInput.SelectedItem; Room room = (Room)roomInput.SelectedItem; if (movie == null) { GuiHelper.ShowError("Je moet een film kiezen"); return; } if (room == null) { GuiHelper.ShowError("Je moet een zaal kiezen"); return; } // Create and save show Show show = new Show(movie.id, room.id, datetimeInput.Value); if (!showService.SaveShow(show)) { GuiHelper.ShowError(ValidationHelper.GetErrorList(show)); return; } // Redirect to screen ShowDetail showDetail = app.GetScreen <ShowDetail>("showDetail"); showDetail.SetShow(show); app.ShowScreen(showDetail); GuiHelper.ShowInfo("Voorstelling succesvol aangemaakt"); }