private void btnModificar_Click(object sender, EventArgs e) { int index = lstJugadores.SelectedIndex; if (index > -1) { frmJugador Jugador = new frmJugador(this._equipo.GetJugadores()[index]); Jugador.ShowDialog(); if (Jugador.DialogResult == System.Windows.Forms.DialogResult.OK) { this._equipo.GetJugadores()[index] = Jugador.GetJugador(); MessageBox.Show("Jugador modificado con exito"); this.Agregar(); } } }
private void btnAgregar_Click(object sender, EventArgs e) { frmJugador miFormulario = new frmJugador(); miFormulario.ShowDialog(); if (miFormulario.DialogResult == System.Windows.Forms.DialogResult.OK) { if (this._equipo + miFormulario.GetJugador()) { MessageBox.Show("Se agrego exitosamente"); this.Agregar(); } else { MessageBox.Show("No se pudo agregar"); } } }