//Load round public void LoadRound() { RoundBL RoundBL = new RoundBL(); Round Round = new Round(); CompetitionBL CompetitionBL = new CompetitionBL(); List<Competition> ListCompetition; ListCompetition = CompetitionBL.GetCompetition(); if (ListCompetition != null) { for (int i = 0; i < ListCompetition.Count; i++) { if (cmb_Competition.SelectedItem.ToString() == ListCompetition.ElementAt(i).NameCompetition) { Round.IDCompetition = ListCompetition.ElementAt(i).IDCompetition; idCompetition = ListCompetition.ElementAt(i).IDCompetition; nameCompetition = cmb_Competition.SelectedItem.ToString(); } } } //load commobox round List<Round> ListRound; ListRound = RoundBL.GetRoundByIDCompetition(Round); if (ListRound != null) { for (int i = 0; i < ListRound.Count; i++) { cmb_Round.Items.Add(ListRound.ElementAt(i).NameRound); } } if (cmb_Round.Items.Count > 0) { cmb_Round.SelectedIndex = 0; } }