private void TeamBewerken() { Team editTeam = (Team)lboxTeams.SelectedItem; if (editTeam == null) { return; // Stoppen indien niets geselecteerd. } FrmEditTeam editForm = new FrmEditTeam(editTeam); DialogResult result = editForm.ShowDialog(this); if (result == DialogResult.OK) { SelectedTeam = editForm.Team; SelectedLid = (Lid)lboxLeden.SelectedItem; lboxTeams.SelectedItem = editTeam; UpdateLijsten(); } }
private void NieuwTeam() { FrmEditTeam editTeam = new FrmEditTeam(); DialogResult result = editTeam.ShowDialog(this); if (result == DialogResult.OK) { Team newTeam = editTeam.Team; try { DataModel.TeamToevoegen(newTeam); } catch (TeamNaamAlGebruiktException ex) { MessageBox.Show(ex.Message, "Teamnaam al gebruikt!", MessageBoxButtons.OK, MessageBoxIcon.Error); } SelectedTeam = newTeam; UpdateLijsten(); } }