Exemple #1
0
        // Handle Delete Button Click
        private void Btn_DelStudent_Click(object sender, EventArgs e)
        {
            students.Remove(selectedStudent);

            StudentsDB.SaveStudents(students);

            List_Students.ClearSelected();
        }
Exemple #2
0
        // Adds new student to the list
        public void InsertUpdateStudentList(Student newStudent)
        {
            students.Add(newStudent);

            StudentsDB.SaveStudents(students);

            UpdateDataSource();
            List_Students.SetSelected(0, true);
        }
Exemple #3
0
        // Assigns and Updates DateBindings
        public void UpdateDataSource()
        {
            // Reads students list from file
            students = StudentsDB.GetStudents();

            List_Students.DataSource    = null;
            List_Students.DataSource    = students;
            List_Students.DisplayMember = "DisplayName";
        }
Exemple #4
0
        // Updates student scores
        public void UpdateStudentScoresList(Student studentToUpdate, BindingList <int> newScores)
        {
            studentToUpdate.Scores = newScores;

            StudentsDB.SaveStudents(students);

            UpdateDataSource();
            List_Students.ClearSelected();
        }