private void OpenEditForm(String tableName) { switch (tableName) { case "Athletes": FormAddAthlete formAddAthlete = new FormAddAthlete(this); formAddAthlete.ButtonName = "Edit"; formAddAthlete.ShowDialog(); break; case "Arenas": FormAddArena formAddArena = new FormAddArena(this); formAddArena.ButtonName = "Edit"; formAddArena.ShowDialog(); break; case "Competitions": FormAddCompetition formAddCompetition = new FormAddCompetition(this); formAddCompetition.ButtonName = "Edit"; formAddCompetition.ShowDialog(); break; case "Countries": FormAddCountry formAddCountry = new FormAddCountry(this); formAddCountry.ButtonName = "Edit"; formAddCountry.ShowDialog(); break; case "Teams": FormAddTeam formAddTeam = new FormAddTeam(this); formAddTeam.ButtonName = "Edit"; formAddTeam.ShowDialog(); break; default: MessageBox.Show("Wrong table name in combobox selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } }
private void button4_Click(object sender, EventArgs e) { FormAddAthlete formAdd = new FormAddAthlete(this); formAdd.ShowDialog(); }