private void BindSubNode(TreeNode pNode, DataTable dtClass)
        {
            if (pNode == null || dtClass == null)
            {
                return;
            }

            ReportTemplateClassData pClassData = pNode.Tag as ReportTemplateClassData;

            DataRow[] drSubs = dtClass.Select("上级分类ID='" + pClassData.模板分类ID + "'");

            if (drSubs.Length <= 0)
            {
                return;
            }

            foreach (DataRow drCur in drSubs)
            {
                ReportTemplateClassData subClassData = new ReportTemplateClassData();
                subClassData.BindRowData(drCur);

                TreeNode tnSub = pNode.Nodes.Add(subClassData.模板分类ID, subClassData.分类名称, 0);
                tnSub.SelectedImageIndex = 0;
                tnSub.Tag = subClassData;

                tnSub.Nodes.Add("TMP" + subClassData.模板分类ID, "TMP");

                BindSubNode(tnSub, dtClass);
            }
        }
        /// <summary>
        /// 绑定模板分类数据
        /// </summary>
        private void BindTemplateClassData()
        {
            DataTable dtClass = _rtm.GetTemplateClass(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;

                ReportTemplateClassData classData = new ReportTemplateClassData();
                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);

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

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

            treeView1.ExpandAll();
        }