71 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace DocumentManagement
 | |
| {
 | |
|     public partial class frmViewSelect : Form
 | |
|     {
 | |
|         /// <summary>
 | |
|         /// 知识库EntryId
 | |
|         /// </summary>
 | |
|         public string EntryId;
 | |
|         /// <summary>
 | |
|         /// 返回结果
 | |
|         /// </summary>
 | |
|         public string VcName = string.Empty;
 | |
|         public frmViewSelect()
 | |
|         {
 | |
|             InitializeComponent();
 | |
|         }
 | |
| 
 | |
|         private void btnSave_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             VcName = tvReflection.SelectedNode == null ? string.Empty : tvReflection.SelectedNode.Text;
 | |
|             Close();
 | |
|         }
 | |
| 
 | |
|         private void btnCancel_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             Close();
 | |
|         }
 | |
| 
 | |
|         private void frmViewSelect_Load(object sender, EventArgs e)
 | |
|         {
 | |
|             TreeNode root = new TreeNode()
 | |
|             {
 | |
|                 Text = "视图映射列表",
 | |
|                 ForeColor = SystemColors.GrayText
 | |
|             };
 | |
|             //DocumentDAL dal = new DocumentDAL();
 | |
|             DataTable dt = DocumentDAL.GetReflectionList();
 | |
|             for (int i = 0; i < dt.Rows.Count; i++)
 | |
|             {
 | |
|                 TreeNode node = new TreeNode();
 | |
|                 node.Text = dt.Rows[i][0].ToString();
 | |
|                 if (!dt.Rows[i][1].ToString().Equals(string.Empty) && !dt.Rows[i][1].ToString().Equals(EntryId))
 | |
|                 {
 | |
|                     node.ForeColor = SystemColors.GrayText;
 | |
|                 }
 | |
|                 root.Nodes.Add(node);
 | |
|             }
 | |
|             tvReflection.Nodes.Add(root);
 | |
|             tvReflection.ExpandAll();
 | |
|         }
 | |
| 
 | |
|         private void tvReflection_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 | |
|         {
 | |
|             TreeNode node = tvReflection.SelectedNode;
 | |
|             if (node.Parent != null)
 | |
|             {
 | |
|                 btnSave_Click(null, null);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |