/// <summary>
        /// 绑定词句项目
        /// </summary>
        private void BindWordItem(TreeNode tnClass)
        {
            if (tnClass == null)
            {
                return;
            }


            ReportWordsClassData classData = tnClass.Tag as ReportWordsClassData;

            if (classData == null)
            {
                return;
            }

            TreeNode[] tmpNodes = tnClass.Nodes.Find("TMP" + classData.词句分类ID, false);
            if (tmpNodes.Length <= 0)
            {
                return;
            }

            DataTable dtItem = _rwm.GetWordItemByClass(classData.词句分类ID);

            foreach (DataRow dr in dtItem.Rows)
            {
                ReportWordsInfoData itemData = new ReportWordsInfoData();
                itemData.BindRowData(dr);

                TreeNode tnItem = tnClass.Nodes.Add(itemData.词句ID, itemData.词句名称, 1);
                tnItem.SelectedImageIndex = 1;
                tnItem.Tag = itemData;
            }

            tnClass.Nodes.Remove(tmpNodes[0]);
        }
示例#2
0
        /// <summary>
        /// 绑定词句项目
        /// </summary>
        private void BindWordItem(TreeNode tnClass)
        {
            listView1.Clear();

            if (tnClass == null)
            {
                return;
            }

            ReportWordsClassData classData = tnClass.Tag as ReportWordsClassData;

            if (classData == null)
            {
                return;
            }


            DataTable dtItem = _rwm.GetWordItemByClass(classData.词句分类ID);

            foreach (DataRow dr in dtItem.Rows)
            {
                ReportWordsInfoData wordInfo = new ReportWordsInfoData();
                wordInfo.BindRowData(dr);

                ListViewItem lvi = listView1.Items.Add(wordInfo.词句名称, 0);
                lvi.Tag = wordInfo;
            }
        }