Esempio n. 1
0
        private void button_delete_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Student will be permanently deleted, are you sure?", "caption", MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
                MessageBox.Show("Student didn't deleted");
            }
            else
            {
                SettingDatabase.DeleteStudent(currentStudent);
                currentStudent = new Student();
                DbContextDal dal = new DbContextDal();
                comboBox_ID.Items.Clear();
                List <Student> students = students = dal.students.ToList();
                foreach (Student item in students)
                {
                    comboBox_ID.Items.Add(item.ID);
                }
                label_details.Hide();
                textBox_details.Hide();
            }
        }
Esempio n. 2
0
 public bool DeleteStudentFromSystem(Student s)
 {
     return(SettingDatabase.DeleteStudent(s));
 }