Exemplo n.º 1
0
        private void buttonMainAdaugaParticipant_Click(object sender, EventArgs e)
        {
            string      nume        = textBoxMainNume.Text;
            int         varsta      = Int32.Parse(numericUpDownVarsta.Value.ToString());
            Participant participant = new Participant(1, nume, varsta, 0);

            try
            {
                controller.AdaugaParticipant(participant);
                MessageBox.Show("Participant adaugat cu succes!");
            }
            catch (ValidationException ve)
            {
                MessageBox.Show(ve.Message);
            }
            buttonMainAdaugaParticipant.Enabled = false;
            buttonMainAdaugaParticipare.Enabled = false;
            textBoxMainNume.Text = "";
            dataGridViewParticipanti.Invoke(new Action(() => dataGridViewParticipanti.ClearSelection()));
            comboBoxMainProba.SelectedItem = null;
            comboBoxMainProba.SelectedItem = null;
        }