private void selectPlanetButton_Click(object sender, EventArgs e) { ApiController apiControl = new ApiController(); ExoPlanet planet = new ExoPlanet(); try { foreach (ExoPlanet x in apiControl.ApiCallExoPlanet(selectPlanetCombo.SelectedItem.ToString())) { FormPlanet forPlanet = new FormPlanet(x, sender, e); forPlanet.ShowDialog(); selectPlanetCombo.Refresh(); } } catch (Exception ex) { new Error(ex).ShowDialog(); } }
private void searchPlanetButton_Click(object sender, EventArgs e) { ApiController apiControl = new ApiController(); ExoPlanet planet = new ExoPlanet(); int count = 0; try { foreach (ExoPlanet x in apiControl.ApiCallExoPlanet(searchPlanetBox.Text)) { count++; FormPlanet forPlanet = new FormPlanet(x, sender, e); forPlanet.ShowDialog(); if (count == 5) { return; } } } catch (Exception ex) { new Error(ex).ShowDialog(); } }