示例#1
0
        /// <summary>
        /// 绑定词句分类数据
        /// </summary>
        private void BindWordClassData()
        {
            DataTable dtClass = _rwm.GetWordsClass(_imgKind);

            if (dtClass.Rows.Count <= 0)
            {
                return;
            }

            DataRow[] drRoots = dtClass.Select("上级分类ID is null or 上级分类ID=''");


            foreach (DataRow drRoot in drRoots)
            {
                TreeNode rootNode = null;

                ReportWordsClassData classData = new ReportWordsClassData();
                classData.BindRowData(drRoot);

                rootNode = treeView1.Nodes.Add(classData.词句分类ID, classData.分类名称, 0);

                rootNode.SelectedImageIndex = 0;
                rootNode.Tag = classData;

                if (rootNode == null)
                {
                    continue;
                }

                BindSubNode(rootNode, dtClass);
            }

            treeView1.ExpandAll();
        }
        /// <summary>
        /// 绑定词句分类数据
        /// </summary>
        private void BindWordClassData()
        {
            DataTable dtClass = _rwm.GetWordsClass(cbxImageKind.Text);

            if (dtClass.Rows.Count <= 0)
            {
                return;
            }

            DataRow[] drRoots = dtClass.Select("上级分类ID is null or 上级分类ID=''");


            foreach (DataRow drRoot in drRoots)
            {
                TreeNode rootNode = null;

                ReportWordsClassData classData = new ReportWordsClassData();
                classData.BindRowData(drRoot);

                rootNode = treeView1.Nodes.Add(classData.词句分类ID, classData.分类名称, 0);

                rootNode.SelectedImageIndex = 0;
                rootNode.Tag = classData;

                rootNode.Nodes.Add("TMP" + classData.词句分类ID, "TMP");


                if (rootNode == null)
                {
                    continue;
                }

                BindSubNode(rootNode, dtClass);

                //绑定当前分类及下一级分类的检查项目
                BindWordItem(rootNode);

                foreach (TreeNode tnSub in rootNode.Nodes)
                {
                    BindWordItem(tnSub);
                }
            }
        }