Exemple #1
0
        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;
            }
        }
Exemple #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            FormAddCompetition formAdd = new FormAddCompetition(this);

            formAdd.ShowDialog();
        }