private void btn_newPoint_Click(object sender, EventArgs e) { CreatePointForm createPointForm = new CreatePointForm(CurrentMatch.HomeWrestler, CurrentMatch.AwayWrestler); this.Hide(); createPointForm.ShowDialog(); if (createPointForm.NewPoint != null) { CurrentMatch.PointsScored.Add(createPointForm.NewPoint); lst_allPoints.Items.Add(createPointForm.NewPoint); } this.Show(); }
private void btn_editPoint_Click(object sender, EventArgs e) { CreatePointForm newPointForm = new CreatePointForm(); newPointForm.CurrentHomeWrestler = CurrentMatch.HomeWrestler; newPointForm.CurrentAwayWrestler = CurrentMatch.AwayWrestler; newPointForm.NewPoint = (Classes.Point)lst_allPoints.SelectedItem; this.Hide(); newPointForm.ShowDialog(); if (newPointForm.NewPoint != null) { CurrentMatch.PointsScored[lst_allPoints.SelectedIndex] = newPointForm.NewPoint; lst_allPoints.Items[lst_allPoints.SelectedIndex] = newPointForm.NewPoint; } this.Show(); }