Exemplo n.º 1
0
        //This will show a new dialog form for creating a new entry into the student list
        private void newBtn_Click_1(object sender, EventArgs e)
        {
            bool          edit          = false;
            CreateStudent createStudent = new CreateStudent(students, edit);

            createStudent.ShowDialog();
            Global.changes = true;
            RefreshList();
        }
Exemplo n.º 2
0
        //FINISHED: this code needs to be updated to reselect the proper index after editing or
        //perhaps even after creating a student
        private void editBtn_Click(object sender, EventArgs e)
        {
            bool edit     = true;
            int  curIndex = -1;

            if (studentList.SelectedIndex != -1)
            {
                curIndex = studentList.SelectedIndex;
            }
            CreateStudent createStudent = new CreateStudent(students, edit, selected);

            createStudent.ShowDialog();
            Global.changes = true;
            searchBox.Clear();
            RefreshList();
            studentList.SelectedIndex = curIndex;
        }