Example #1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            StudentInfo studentInfo = new StudentInfo();

            if (treeView1.SelectedNode.Text == "计算机科学与技术")
            {
                studentInfo.Profession   = "计算机科学与技术";
                dataGridView1.DataSource = StudentInfoBLL.GetStudentInfoList(studentInfo);
            }
            else if (treeView1.SelectedNode.Text == "电子信息科学与技术")
            {
                studentInfo.Profession   = "电子信息科学与技术";
                dataGridView1.DataSource = StudentInfoBLL.GetStudentInfoList(studentInfo);
            }
            else if (treeView1.SelectedNode.Text == "信息安全")
            {
                studentInfo.Profession   = "信息安全";
                dataGridView1.DataSource = StudentInfoBLL.GetStudentInfoList(studentInfo);
            }
            else
            {
                dataGridView1.DataSource = StudentInfoBLL.GetAllStudentInfo();
            }
        }