?? knowledgemanage.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using CallCenter.DALFactory;
using CallCenter.IDAL;
using CallCenter.Modules;
using CallCenter.BusinessLayer;
using DevExpress.Utils;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
using DevExpress.XtraTreeList.Nodes;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// KnowledgeManage 的摘要說明。
/// </summary>
public class KnowledgeManage : System.Windows.Forms.UserControl
{
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 System.Data.DataSet ds;
private KnowledgeTypeBLL bll = new KnowledgeTypeBLL();
private System.Windows.Forms.Panel panel1;
private DevExpress.XtraTreeList.TreeList treeList1;
private DevExpress.XtraEditors.PanelControl panel2;
private int i=0;
private string strnumber="";
private KnowledgeInfo knowledgeinfo=null;
private CallCenter.BusinessInterfaces.MainForms.HRichTextBox hRichTextBox1;
private System.Windows.Forms.TextBox txtcamount;
private System.Windows.Forms.TextBox txtiamount;
private System.Windows.Forms.TextBox txtoamount;
private System.Windows.Forms.TextBox txtkaname;
private System.Windows.Forms.TextBox txtkaid;
private System.Windows.Forms.TextBox txtkwdate;
private System.Windows.Forms.TextBox txtkwname;
private System.Windows.Forms.TextBox txtkwid;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private DevExpress.XtraEditors.PanelControl panelControl1;
private DevExpress.XtraEditors.TextEdit txtktitle;
private DevExpress.XtraEditors.TextEdit txtktype;
private DevExpress.XtraEditors.TextEdit txtkkeywords;
private DevExpress.XtraEditors.ComboBoxEdit cboamark;
private DevExpress.XtraEditors.SimpleButton btAdd;
private DevExpress.XtraEditors.SimpleButton btReset;
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public KnowledgeManage()
{
//
// Windows 窗體設(shè)計(jì)器支持所必需的
//
InitializeComponent();
ds = bll.getKnowledgeType("KNOWLEDGETYPE");
ClearData();
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
}
public KnowledgeManage(KnowledgeInfo kinfo)
{
InitializeComponent();
try
{
ds = bll.getKnowledgeType("KNOWLEDGETYPE");
knowledgeinfo=new KnowledgeInfo();
knowledgeinfo=kinfo;
this.txtktitle.Text=kinfo.ktitle;
string str="";
strnumber=kinfo.ktype.Substring(1,kinfo.ktype.Length - 1);
string s=kinfo.ktype.Substring(1,kinfo.ktype.Length - 2);
// MessageBox.Show(s);
DataRow[] drp=ds.Tables["KNOWLEDGETYPE"].Select("id in ("+s+")");
foreach(DataRow dr in drp)
{
str+=dr[ds.Tables["KNOWLEDGETYPE"].Columns["tname"]].ToString()+",";
}
//////kinfo.ktype=","+strnumber;
this.txtktype.Text=","+str;
this.txtkkeywords.Text=kinfo.kkeywords;
this.txtkwid.Text=kinfo.kwid;
this.txtkwname.Text=kinfo.kwname;
this.txtkwdate.Text=kinfo.kwdate;//DateTime.Today.ToString();
if(kinfo.oamark==0)
{
this.cboamark.Text="不可訪問";
}
else
{
this.cboamark.Text="可訪問";
}
this.txtkaid.Text=kinfo.kaid;
this.txtkaname.Text=kinfo.kaname;
this.txtoamount.Text=kinfo.oamount.ToString();
this.txtiamount.Text=kinfo.iamount.ToString();
this.txtcamount.Text=kinfo.camount.ToString();
// this.txtkcontent.Rtf=kinfo.kcontent;
this.hRichTextBox1.RtfText=kinfo.kcontent;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
// i=0;
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.treeList1 = new DevExpress.XtraTreeList.TreeList();
this.panel2 = new DevExpress.XtraEditors.PanelControl();
this.btReset = new DevExpress.XtraEditors.SimpleButton();
this.btAdd = new DevExpress.XtraEditors.SimpleButton();
this.cboamark = new DevExpress.XtraEditors.ComboBoxEdit();
this.txtkkeywords = new DevExpress.XtraEditors.TextEdit();
this.txtktype = new DevExpress.XtraEditors.TextEdit();
this.txtktitle = new DevExpress.XtraEditors.TextEdit();
this.label7 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtcamount = new System.Windows.Forms.TextBox();
this.txtiamount = new System.Windows.Forms.TextBox();
this.txtoamount = new System.Windows.Forms.TextBox();
this.txtkaid = new System.Windows.Forms.TextBox();
this.txtkwdate = new System.Windows.Forms.TextBox();
this.txtkwname = new System.Windows.Forms.TextBox();
this.txtkwid = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.txtkaname = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.hRichTextBox1 = new CallCenter.BusinessInterfaces.MainForms.HRichTextBox();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panel2)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cboamark.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txtkkeywords.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txtktype.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txtktitle.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
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(184, 549);
this.panel1.TabIndex = 0;
//
// 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(0, 0);
this.treeList1.Name = "treeList1";
this.treeList1.OptionsMenu.EnableColumnMenu = false;
this.treeList1.Size = new System.Drawing.Size(184, 549);
this.treeList1.TabIndex = 0;
//
// panel2
//
this.panel2.Appearance.BackColor = System.Drawing.Color.Transparent;
this.panel2.Appearance.Options.UseBackColor = true;
this.panel2.Controls.Add(this.btReset);
this.panel2.Controls.Add(this.btAdd);
this.panel2.Controls.Add(this.cboamark);
this.panel2.Controls.Add(this.txtkkeywords);
this.panel2.Controls.Add(this.txtktype);
this.panel2.Controls.Add(this.txtktitle);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.label2);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.txtcamount);
this.panel2.Controls.Add(this.txtiamount);
this.panel2.Controls.Add(this.txtoamount);
this.panel2.Controls.Add(this.txtkaid);
this.panel2.Controls.Add(this.txtkwdate);
this.panel2.Controls.Add(this.txtkwname);
this.panel2.Controls.Add(this.txtkwid);
this.panel2.Controls.Add(this.label12);
this.panel2.Controls.Add(this.label11);
this.panel2.Controls.Add(this.label10);
this.panel2.Controls.Add(this.label9);
this.panel2.Controls.Add(this.label8);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.label5);
this.panel2.Controls.Add(this.txtkaname);
this.panel2.Controls.Add(this.label4);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(184, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(668, 128);
this.panel2.TabIndex = 2;
//
// btReset
//
this.btReset.Location = new System.Drawing.Point(560, 64);
this.btReset.Name = "btReset";
this.btReset.TabIndex = 58;
this.btReset.Text = "清空";
this.btReset.Click += new System.EventHandler(this.btReset_Click);
//
// btAdd
//
this.btAdd.Location = new System.Drawing.Point(560, 16);
this.btAdd.Name = "btAdd";
this.btAdd.TabIndex = 57;
this.btAdd.Tag = "添加";
this.btAdd.Text = "添加";
this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
//
// cboamark
//
this.cboamark.EditValue = "";
this.cboamark.Location = new System.Drawing.Point(96, 96);
this.cboamark.Name = "cboamark";
//
// cboamark.Properties
//
this.cboamark.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
this.cboamark.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.cboamark.Properties.Items.AddRange(new object[] {
"不可訪問",
"可訪問"});
this.cboamark.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
this.cboamark.Size = new System.Drawing.Size(160, 21);
this.cboamark.TabIndex = 56;
//
// txtkkeywords
//
this.txtkkeywords.EditValue = "";
this.txtkkeywords.Location = new System.Drawing.Point(75, 69);
this.txtkkeywords.Name = "txtkkeywords";
//
// txtkkeywords.Properties
//
this.txtkkeywords.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Default;
this.txtkkeywords.Size = new System.Drawing.Size(453, 21);
this.txtkkeywords.TabIndex = 55;
//
// txtktype
//
this.txtktype.EditValue = "";
this.txtktype.Location = new System.Drawing.Point(75, 45);
this.txtktype.Name = "txtktype";
//
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -