Ejemplo n.º 1
0
        private void SaveChanges(object sender, EventArgs e)
        {
            var firstName   = firstNameTextBox.Text;
            var lastName    = lastNameTextBox.Text;
            var dateOfBirth = dateOfBirthDTP.Value;
            var gender      = genderListBox.SelectedItem as string;
            var grade       = gradeTextBox.Text;

            var isSaved = _studentsRepository.AddOrEditAStudent(firstName, lastName, dateOfBirth, gender, grade, _student.StudentId);

            if (!isSaved)
            {
                MessageBox.Show("Pogreska pri unosu. Sva polja moraju imati sadrzaj! Razred mora biti formata broj.slovo", "Error", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
            else
            {
                MessageBox.Show("Ucenik uspjesno spremljen!", "Message", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                Close();
            }
        }