コード例 #1
0
        private void EditStudent()
        {
            ClsStudent lcStudent = (ClsStudent)lstStudents.SelectedItem;

            if (lcStudent != null && lcStudent.ViewEdit())
            {
                UpdateDisplay();
            }
        }
コード例 #2
0
        private void btnCreateStudent_Click(object sender, EventArgs e)
        {
            ClsStudent lcStudent = ClsStudent.NewStudent(cboStudentType.SelectedIndex);

            if (lcStudent != null && lcStudent.ViewEdit())
            {
                ClsInstitute.StudentList.Add(lcStudent.ID, lcStudent);
                UpdateDisplay();
            }
        }
コード例 #3
0
        private void btnDltStudent_Click(object sender, EventArgs e)
        {
            ClsStudent lcStudent = (ClsStudent)lstStudents.SelectedItem;

            if (lcStudent != null && DialogResult.Yes == MessageBox.Show("Are you sure you want to delete the selected Student?", "Delete Student", MessageBoxButtons.YesNo))
            {
                ClsInstitute.StudentList.Remove(lcStudent.ID);
                UpdateDisplay();
            }
        }
コード例 #4
0
 public DialogResult ShowDialog(ClsStudent prStudent)
 {
     _Student = prStudent;
     UpdateDisplay();
     return(ShowDialog());
 }