private void módosítás_Click(object _sender, EventArgs _event) { if ((table.SelectedRows.Count == 0) || (table.SelectedRows[0].Index == data.Rows.Count)) { return; } foreach (DataGridViewRow current in table.Rows) { if (table.SelectedRows[0] == current) { Form_Korosztály korosztály = new Form_Korosztály(box_vazon.Text, new Korosztály(current.Cells[0].Value.ToString(), current.Cells[1].Value.ToString(), current.Cells[2].Value.ToString(), Convert.ToInt32(current.Cells[3].Value), Convert.ToInt32(current.Cells[4].Value), (bool)current.Cells[5].Value, (bool)current.Cells[6].Value, Convert.ToInt32(current.Cells[7].Value), Convert.ToInt32(current.Cells[8].Value), (bool)current.Cells[9].Value)); korosztály.ShowDialog( ); break; } } }
private void hozzáadás_Click(object _sender, EventArgs _event) { if (box_vazon.SelectedItem == null) { MessageBox.Show("Nincs kiválasztva verseny!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Form_Korosztály korosztály = new Form_Korosztály(box_vazon.Text); korosztály.ShowDialog( ); }