public formReportMundial() { InitializeComponent(); for (var year = DateTime.Now.Year; year >= 1900; year--) { cbYearFiltro.Items.Add(year); } cbYearFiltro.SelectedItem = formPrincipal.yearPreferences; mundial = new Negocio.Mundial(); btnImprimir.Enabled = false; }
public formPartidos() { InitializeComponent(); for (var year = DateTime.Now.Year; year >= 1900; year--) { cbYearFiltro.Items.Add(year); } cbYearFiltro.SelectedItem = formPrincipal.yearPreferences; this.mundial = new Negocio.Mundial(); }
/// <summary> /// Se cargan en el DataGrid los partidos correspondientes al año seleccionado /// </summary> private void getPartidos() { Negocio.Mundial mundial; List <Entidades.Partido> listPartidos; cbYear.Enabled = false; dataGridView1.Enabled = false; dataGridView1.DataSource = null; try { mundial = new Negocio.Mundial(); listPartidos = mundial.getPartidosAnyo((int)cbYear.SelectedItem); dataGridView1.DataSource = listPartidos; } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error obteniendo los datos del mundial: " + ex.Message); } cbYear.Enabled = true; dataGridView1.Enabled = true; }