private void UpdateTeamOfficial() { int si = 0; TeamOfficial temp = null; try { si = lsvTeamOfficial.SelectedItems[0].Index; temp = teamOfficialByTeam[si]; } catch { MessageBox.Show("Please select you wish to update"); return; } Team team = Team.GetTeam(listOfTeam, (int)cmbTeam.SelectedValue); using (Form f = new frmSaveTeamOfficial(team, teamOfficialByTeam, temp)) { if (DialogResult.OK == f.ShowDialog()) { MessageBox.Show("Sucessfully updated team official"); listOfTeamOfficial = TeamOfficialHelper.GetAllOfficial(tournament); GetAllTeamOfficial(); } } }
private void AddTeamOfficial() { Team team = Team.GetTeam(listOfTeam, (int)cmbTeam.SelectedValue); if (teamOfficialByTeam.Count >= 3) { MessageBox.Show("There's no available slot for team official [" + team.teamName + "]"); return; } using (Form f = new frmSaveTeamOfficial(team, teamOfficialByTeam)) { if (DialogResult.OK == f.ShowDialog()) { MessageBox.Show("Sucessfully added team official"); listOfTeamOfficial = TeamOfficialHelper.GetAllOfficial(tournament); GetAllTeamOfficial(); } } }