private void buttonEconomy_Click(object sender, EventArgs e) { HTEntities.TeamDetails.TeamDetails teamDetails = entityManager.GetTeamDetails(); HTEntities.WorldDetails.League league = null; foreach (HTEntities.WorldDetails.League currentLeague in entityManager.GetWorldDetails().leagueListField) { if (currentLeague.leagueIdField == teamDetails.teamField.leagueField.leagueIdField) { league = currentLeague; break; } } using (FormEconomy formEconomy = new FormEconomy(entityManager.GetEconomy(), league, currentUser)) { formEconomy.ShowDialog(this); } }