📄 knowledgeform.cs
字号:
using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
using DevExpress.XtraTreeList.Nodes;
using CallCenter.Modules;
using CallCenter.BusinessLayer;
using CallCenter.BusinessInterfaces;
using CallCenter.BusinessInterfaces.MainForms;
using CallCenter.BusinessInterfaces.BaseForms.Models;
namespace CallCenter.BusinessInterfaces.BaseForms {
/// <summary>
/// KnowledgeForm 知识检索窗体。
/// author:yanqingxi
/// </summary>
public class KnowledgeForm : System.Windows.Forms.UserControl {
private DevExpress.XtraEditors.PanelControl panel1;
private DevExpress.XtraTreeList.TreeList treeList1;
private DevExpress.XtraTreeList.Columns.TreeListColumn colTNAME;
private DevExpress.XtraTreeList.Columns.TreeListColumn colOAMARK;
private DevExpress.XtraTreeList.Columns.TreeListColumn colID;
private DevExpress.XtraTreeList.Columns.TreeListColumn colPARENTID;
private DevExpress.XtraTreeList.TreeList treeList2;
private DevExpress.XtraTreeList.Columns.TreeListColumn colTNAME1;
private DevExpress.XtraTreeList.Columns.TreeListColumn colOAMARK1;
private DevExpress.XtraTreeList.Columns.TreeListColumn colID1;
private DevExpress.XtraTreeList.Columns.TreeListColumn colPARENTID1;
private System.Data.DataSet ds;
private KnowledgeTypeBLL bll = new KnowledgeTypeBLL();
private DevExpress.XtraEditors.PanelControl RightPanel;
private DevExpress.XtraEditors.GroupControl groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private DevExpress.XtraEditors.PanelControl KLVPanel;
private DevExpress.XtraEditors.PanelControl panel2;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.ContextMenu ctMenu_Edit;
private IList m_KList;
int[] DisPlayCol ={1,3};
private string m_kType=string.Empty;
private KnowledgeBLL m_KnowledgeBLL = new KnowledgeBLL();
private KnowledgeInfo m_KnowledgeInfo=new KnowledgeInfo();
private ListViewHelper knowledageLV = new ListViewHelper();
private KnowledgeInfoColumn m_KLVColName = new KnowledgeInfoColumn();
private DevExpress.XtraEditors.TextEdit tbTitle;
private DevExpress.XtraEditors.TextEdit tbKeyWords;
private DevExpress.XtraEditors.TextEdit tbType;
private DevExpress.XtraEditors.SimpleButton btnRetrieve;
private DevExpress.XtraEditors.SimpleButton btnReset;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public KnowledgeForm() {
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
InitKListView();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing ) {
if( disposing ) {
if(components != null) {
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent() {
this.panel1 = new DevExpress.XtraEditors.PanelControl();
this.treeList2 = new DevExpress.XtraTreeList.TreeList();
this.treeList1 = new DevExpress.XtraTreeList.TreeList();
this.RightPanel = new DevExpress.XtraEditors.PanelControl();
this.KLVPanel = new DevExpress.XtraEditors.PanelControl();
this.panel2 = new DevExpress.XtraEditors.PanelControl();
this.groupBox1 = new DevExpress.XtraEditors.GroupControl();
this.btnReset = new DevExpress.XtraEditors.SimpleButton();
this.btnRetrieve = new DevExpress.XtraEditors.SimpleButton();
this.tbType = new DevExpress.XtraEditors.TextEdit();
this.tbKeyWords = new DevExpress.XtraEditors.TextEdit();
this.tbTitle = new DevExpress.XtraEditors.TextEdit();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.splitter1 = new System.Windows.Forms.Splitter();
this.ctMenu_Edit = new System.Windows.Forms.ContextMenu();
((System.ComponentModel.ISupportInitialize)(this.panel1)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeList2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.RightPanel)).BeginInit();
this.RightPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.KLVPanel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panel2)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.groupBox1)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbType.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbKeyWords.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbTitle.Properties)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.treeList2);
this.panel1.Controls.Add(this.treeList1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(240, 504);
this.panel1.TabIndex = 0;
//
// treeList2
//
this.treeList2.Appearance.Empty.BackColor = System.Drawing.Color.White;
this.treeList2.Appearance.Empty.Options.UseBackColor = true;
this.treeList2.Appearance.GroupButton.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.treeList2.Appearance.GroupButton.Options.UseBackColor = true;
this.treeList2.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.treeList2.Appearance.GroupFooter.Options.UseBackColor = true;
this.treeList2.Appearance.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(219)), ((System.Byte)(233)), ((System.Byte)(244)));
this.treeList2.Appearance.HeaderPanel.Options.UseBackColor = true;
this.treeList2.Appearance.Row.BackColor = System.Drawing.Color.White;
this.treeList2.Appearance.Row.Options.UseBackColor = true;
this.treeList2.Appearance.TreeLine.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(90)), ((System.Byte)(180)), ((System.Byte)(232)));
this.treeList2.Appearance.TreeLine.Options.UseBackColor = true;
this.treeList2.Location = new System.Drawing.Point(88, 40);
this.treeList2.Name = "treeList2";
this.treeList2.OptionsMenu.EnableColumnMenu = false;
this.treeList2.Size = new System.Drawing.Size(184, 272);
this.treeList2.TabIndex = 0;
this.treeList2.Visible = false;
//
// treeList1
//
this.treeList1.Appearance.Empty.BackColor = System.Drawing.Color.White;
this.treeList1.Appearance.Empty.Options.UseBackColor = true;
this.treeList1.Appearance.GroupButton.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.treeList1.Appearance.GroupButton.Options.UseBackColor = true;
this.treeList1.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.treeList1.Appearance.GroupFooter.Options.UseBackColor = true;
this.treeList1.Appearance.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(219)), ((System.Byte)(233)), ((System.Byte)(244)));
this.treeList1.Appearance.HeaderPanel.Options.UseBackColor = true;
this.treeList1.Appearance.Row.BackColor = System.Drawing.Color.White;
this.treeList1.Appearance.Row.Options.UseBackColor = true;
this.treeList1.Appearance.TreeLine.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(90)), ((System.Byte)(180)), ((System.Byte)(232)));
this.treeList1.Appearance.TreeLine.Options.UseBackColor = true;
this.treeList1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeList1.Location = new System.Drawing.Point(2, 2);
this.treeList1.Name = "treeList1";
this.treeList1.OptionsMenu.EnableColumnMenu = false;
this.treeList1.Size = new System.Drawing.Size(236, 500);
this.treeList1.TabIndex = 0;
//
// RightPanel
//
this.RightPanel.Appearance.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(131)), ((System.Byte)(194)), ((System.Byte)(231)));
this.RightPanel.Appearance.Options.UseBackColor = true;
this.RightPanel.Controls.Add(this.KLVPanel);
this.RightPanel.Controls.Add(this.panel2);
this.RightPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.RightPanel.Location = new System.Drawing.Point(240, 0);
this.RightPanel.Name = "RightPanel";
this.RightPanel.Size = new System.Drawing.Size(616, 504);
this.RightPanel.TabIndex = 1;
//
// KLVPanel
//
this.KLVPanel.Appearance.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(131)), ((System.Byte)(194)), ((System.Byte)(231)));
this.KLVPanel.Appearance.Options.UseBackColor = true;
this.KLVPanel.AutoScroll = true;
this.KLVPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.KLVPanel.Location = new System.Drawing.Point(2, 128);
this.KLVPanel.Name = "KLVPanel";
this.KLVPanel.Size = new System.Drawing.Size(612, 374);
this.KLVPanel.TabIndex = 1;
//
// panel2
//
this.panel2.Appearance.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(131)), ((System.Byte)(194)), ((System.Byte)(231)));
this.panel2.Appearance.Options.UseBackColor = true;
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(2, 2);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(612, 126);
this.panel2.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnReset);
this.groupBox1.Controls.Add(this.btnRetrieve);
this.groupBox1.Controls.Add(this.tbType);
this.groupBox1.Controls.Add(this.tbKeyWords);
this.groupBox1.Controls.Add(this.tbTitle);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(24, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(568, 112);
this.groupBox1.TabIndex = 0;
this.groupBox1.Text = "查询";
//
// btnReset
//
this.btnReset.Location = new System.Drawing.Point(440, 72);
this.btnReset.Name = "btnReset";
this.btnReset.TabIndex = 12;
this.btnReset.Text = "重置";
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// btnRetrieve
//
this.btnRetrieve.Location = new System.Drawing.Point(440, 32);
this.btnRetrieve.Name = "btnRetrieve";
this.btnRetrieve.TabIndex = 11;
this.btnRetrieve.Text = "检索";
this.btnRetrieve.Click += new System.EventHandler(this.btnRetrieve_Click);
//
// tbType
//
this.tbType.EditValue = "";
this.tbType.Location = new System.Drawing.Point(112, 80);
this.tbType.Name = "tbType";
//
// tbType.Properties
//
this.tbType.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
this.tbType.Size = new System.Drawing.Size(312, 21);
this.tbType.TabIndex = 10;
//
// tbKeyWords
//
this.tbKeyWords.EditValue = "";
this.tbKeyWords.Location = new System.Drawing.Point(112, 56);
this.tbKeyWords.Name = "tbKeyWords";
//
// tbKeyWords.Properties
//
this.tbKeyWords.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
this.tbKeyWords.Size = new System.Drawing.Size(312, 21);
this.tbKeyWords.TabIndex = 9;
this.tbKeyWords.EditValueChanged += new System.EventHandler(this.tbKeyWords_EditValueChanged);
//
// tbTitle
//
this.tbTitle.EditValue = "";
this.tbTitle.Location = new System.Drawing.Point(112, 32);
this.tbTitle.Name = "tbTitle";
//
// tbTitle.Properties
//
this.tbTitle.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
this.tbTitle.Size = new System.Drawing.Size(312, 21);
this.tbTitle.TabIndex = 8;
this.tbTitle.EditValueChanged += new System.EventHandler(this.tbTitle_EditValueChanged);
//
// label3
//
this.label3.Location = new System.Drawing.Point(48, 80);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 23);
this.label3.TabIndex = 2;
this.label3.Text = "分 类";
//
// label2
//
this.label2.Location = new System.Drawing.Point(48, 56);
this.label2.Name = "label2";
this.label2.TabIndex = 1;
this.label2.Text = "关键字";
//
// label1
//
this.label1.Location = new System.Drawing.Point(48, 32);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "标 题";
//
// splitter1
//
this.splitter1.Location = new System.Drawing.Point(240, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 504);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
//
// KnowledgeForm
//
this.AutoScroll = true;
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(131)), ((System.Byte)(194)), ((System.Byte)(231)));
this.Controls.Add(this.splitter1);
this.Controls.Add(this.RightPanel);
this.Controls.Add(this.panel1);
this.Name = "KnowledgeForm";
this.Size = new System.Drawing.Size(856, 504);
this.Load += new System.EventHandler(this.KnowledgeForm_Load);
((System.ComponentModel.ISupportInitialize)(this.panel1)).EndInit();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.treeList2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.RightPanel)).EndInit();
this.RightPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.KLVPanel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panel2)).EndInit();
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.groupBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.tbType.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tbKeyWords.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tbTitle.Properties)).EndInit();
this.ResumeLayout(false);
}
#endregion
#region 树相关的方法
IList listAll=new ArrayList();
private IList GetKList(string kType)
{
IList ilist=null;
try
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -