Пример #1
0
        private void btnSalvare_Click(object sender, EventArgs e)
        {
            Studenti student = new Studenti();

            student.NrMatricol = Convert.ToInt32(txtNrMatricol.Text);
            student.Nume       = txtNume.Text;
            student.Medie      = double.Parse(txtMedia.Text);

            if (btnSalvare.Text == "Inserare") // insert
            {
                studentRepository.InserareStudent(student);
            }
            else
            {
                studentRepository.ActualizeazaStudent(student);
            }

            Clear();
            PopulateDataGridView();
            MessageBox.Show("Subscris cu succes");
        }