Пример #1
0
        void BinderSpeciality(string collegeid)
        {
            islock = true;

            DataTable Speciality = TreeViewBLL.GetSpecBLL(collegeid);

            this.cmbBoxSpeciality.DataSource    = Speciality;
            this.cmbBoxSpeciality.DisplayMember = "Speciality_Name";
            this.cmbBoxSpeciality.ValueMember   = "Speciality_ID";

            islock = false;
        }
Пример #2
0
        void bindTreeView()
        {
            try
            {
                DataTable colleges = TreeViewBLL.GetCollegesBLL();
                tvColleges.Nodes.Clear();


                foreach (DataRow row in colleges.Rows)
                {
                    TreeNode tn = new TreeNode(row["College_Name"].ToString());

                    tn.Name = row["College_ID"].ToString();
                    tn.Tag  = "colleges";
                    tvColleges.Nodes.Add(tn);

                    DataTable speciality = TreeViewBLL.GetSpecBLL(row["College_ID"].ToString());
                    foreach (DataRow specrow in speciality.Rows)
                    {
                        TreeNode spec = new TreeNode(specrow["Speciality_Name"].ToString());
                        spec.Name = specrow["Speciality_ID"].ToString();
                        spec.Tag  = "Speciality";
                        tn.Nodes.Add(spec);

                        DataTable classes = TreeViewBLL.GetClassesBLL(specrow["Speciality_ID"].ToString());

                        foreach (DataRow classrow in classes.Rows)
                        {
                            TreeNode classe = new TreeNode(classrow["Classes_Name"].ToString());
                            classe.Name = classrow["Classes_ID"].ToString();
                            classe.Tag  = "Classes";
                            spec.Nodes.Add(classe);
                        }
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("异常!");
            }
        }