📄 usermanage.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CallCenter.BusinessLayer;
using CallCenter.Modules;
using System.Data;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// UserManage 的摘要说明。
/// </summary>
public class UserManage : System.Windows.Forms.UserControl
{
private WebMIS.GoldFilter.GridDataFilter gridDataFilter1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.DataGrid dgUser;
private System.Windows.Forms.ComboBox cobLevel;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DataGrid dgMenu;
private System.Windows.Forms.TextBox txtTelnumber;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txtId;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtLogin;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtPwdC;
private System.Windows.Forms.TextBox txtPwd;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtMenu;
private System.Windows.Forms.Button btDelete;
private System.Windows.Forms.Button btSave;
private System.Windows.Forms.Button btAdd;
private System.Windows.Forms.TextBox txtname;
private System.Windows.Forms.Button btReset;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtDescript;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Panel panel1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public UserManage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// 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.gridDataFilter1 = new WebMIS.GoldFilter.GridDataFilter();
this.panel2 = new System.Windows.Forms.Panel();
this.dgUser = new System.Windows.Forms.DataGrid();
this.cobLevel = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.dgMenu = new System.Windows.Forms.DataGrid();
this.txtTelnumber = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtId = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.txtLogin = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtPwdC = new System.Windows.Forms.TextBox();
this.txtPwd = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtMenu = new System.Windows.Forms.TextBox();
this.btDelete = new System.Windows.Forms.Button();
this.btSave = new System.Windows.Forms.Button();
this.btAdd = new System.Windows.Forms.Button();
this.txtname = new System.Windows.Forms.TextBox();
this.btReset = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.txtDescript = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgUser)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgMenu)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// gridDataFilter1
//
this.gridDataFilter1.checkbox = null;
this.gridDataFilter1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.gridDataFilter1.Location = new System.Drawing.Point(0, 493);
this.gridDataFilter1.Name = "gridDataFilter1";
this.gridDataFilter1.Size = new System.Drawing.Size(808, 32);
this.gridDataFilter1.TabIndex = 3;
//
// panel2
//
this.panel2.Controls.Add(this.dgUser);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 184);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(808, 309);
this.panel2.TabIndex = 5;
//
// dgUser
//
this.dgUser.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgUser.CaptionText = "用户信息列表";
this.dgUser.DataMember = "";
this.dgUser.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgUser.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgUser.Location = new System.Drawing.Point(0, 0);
this.dgUser.Name = "dgUser";
this.dgUser.ReadOnly = true;
this.dgUser.Size = new System.Drawing.Size(808, 309);
this.dgUser.TabIndex = 2;
this.dgUser.CurrentCellChanged += new System.EventHandler(this.dgUser_CurrentCellChanged);
//
// cobLevel
//
this.cobLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cobLevel.ItemHeight = 12;
this.cobLevel.Items.AddRange(new object[] {
"普通操作员",
"系统管理员"});
this.cobLevel.Location = new System.Drawing.Point(88, 48);
this.cobLevel.Name = "cobLevel";
this.cobLevel.Size = new System.Drawing.Size(121, 20);
this.cobLevel.TabIndex = 47;
//
// button1
//
this.button1.BackColor = System.Drawing.SystemColors.MenuText;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Engravers MT", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.button1.ForeColor = System.Drawing.Color.Red;
this.button1.Location = new System.Drawing.Point(418, 82);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(19, 19);
this.button1.TabIndex = 41;
this.button1.Text = "X";
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// dgMenu
//
this.dgMenu.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgMenu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dgMenu.CaptionText = "菜单信息列表";
this.dgMenu.DataMember = "";
this.dgMenu.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgMenu.Location = new System.Drawing.Point(248, 80);
this.dgMenu.Name = "dgMenu";
this.dgMenu.ReadOnly = true;
this.dgMenu.RowHeaderWidth = 0;
this.dgMenu.Size = new System.Drawing.Size(192, 96);
this.dgMenu.TabIndex = 36;
this.dgMenu.Visible = false;
//
// txtTelnumber
//
this.txtTelnumber.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtTelnumber.Location = new System.Drawing.Point(536, 80);
this.txtTelnumber.Name = "txtTelnumber";
this.txtTelnumber.Size = new System.Drawing.Size(112, 21);
this.txtTelnumber.TabIndex = 46;
this.txtTelnumber.Text = "";
//
// label9
//
this.label9.Font = new System.Drawing.Font("宋体", 9F);
this.label9.Location = new System.Drawing.Point(464, 80);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(72, 16);
this.label9.TabIndex = 45;
this.label9.Text = "坐席电话";
//
// txtId
//
this.txtId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtId.Location = new System.Drawing.Point(536, 16);
this.txtId.Name = "txtId";
this.txtId.Size = new System.Drawing.Size(112, 21);
this.txtId.TabIndex = 43;
this.txtId.Text = "";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 9F);
this.label1.Location = new System.Drawing.Point(464, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 16);
this.label1.TabIndex = 42;
this.label1.Text = "坐席ID";
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 9F);
this.label7.Location = new System.Drawing.Point(232, 16);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(56, 23);
this.label7.TabIndex = 37;
this.label7.Text = "登陆名";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtLogin
//
this.txtLogin.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtLogin.Location = new System.Drawing.Point(288, 16);
this.txtLogin.Name = "txtLogin";
this.txtLogin.Size = new System.Drawing.Size(120, 21);
this.txtLogin.TabIndex = 38;
this.txtLogin.Text = "";
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 9F);
this.label8.Location = new System.Drawing.Point(24, 80);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(64, 24);
this.label8.TabIndex = 39;
this.label8.Text = "菜单列表";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 9F);
this.label5.Location = new System.Drawing.Point(24, 48);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 23);
this.label5.TabIndex = 29;
this.label5.Text = "级别";
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 9F);
this.label4.Location = new System.Drawing.Point(464, 48);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(72, 23);
this.label4.TabIndex = 26;
this.label4.Text = "密码确认";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtPwdC
//
this.txtPwdC.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtPwdC.Location = new System.Drawing.Point(536, 48);
this.txtPwdC.Name = "txtPwdC";
this.txtPwdC.PasswordChar = '*';
this.txtPwdC.Size = new System.Drawing.Size(112, 21);
this.txtPwdC.TabIndex = 35;
this.txtPwdC.Text = "";
//
// txtPwd
//
this.txtPwd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtPwd.Location = new System.Drawing.Point(288, 48);
this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(120, 21);
this.txtPwd.TabIndex = 34;
this.txtPwd.Text = "";
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 9F);
this.label3.Location = new System.Drawing.Point(232, 48);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 23);
this.label3.TabIndex = 24;
this.label3.Text = "密码";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtMenu
//
this.txtMenu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMenu.Cursor = System.Windows.Forms.Cursors.Arrow;
this.txtMenu.Location = new System.Drawing.Point(88, 80);
this.txtMenu.Name = "txtMenu";
this.txtMenu.Size = new System.Drawing.Size(320, 21);
this.txtMenu.TabIndex = 40;
this.txtMenu.Text = "";
this.txtMenu.MouseMove += new System.Windows.Forms.MouseEventHandler(this.txtMenu_MouseMove);
this.txtMenu.MouseLeave += new System.EventHandler(this.txtMenu_MouseLeave);
//
// btDelete
//
this.btDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btDelete.Location = new System.Drawing.Point(704, 80);
this.btDelete.Name = "btDelete";
this.btDelete.TabIndex = 28;
this.btDelete.Text = "删除";
this.btDelete.Click += new System.EventHandler(this.btDelete_Click);
//
// btSave
//
this.btSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btSave.Location = new System.Drawing.Point(704, 48);
this.btSave.Name = "btSave";
this.btSave.TabIndex = 27;
this.btSave.Text = "修改";
this.btSave.Click += new System.EventHandler(this.btSave_Click);
//
// btAdd
//
this.btAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btAdd.Location = new System.Drawing.Point(704, 16);
this.btAdd.Name = "btAdd";
this.btAdd.TabIndex = 25;
this.btAdd.Text = "添加";
this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
//
// txtname
//
this.txtname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtname.Location = new System.Drawing.Point(88, 16);
this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(112, 21);
this.txtname.TabIndex = 33;
this.txtname.Text = "";
//
// btReset
//
this.btReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btReset.Location = new System.Drawing.Point(704, 112);
this.btReset.Name = "btReset";
this.btReset.TabIndex = 31;
this.btReset.Text = "清空";
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 9F);
this.label2.Location = new System.Drawing.Point(24, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 23);
this.label2.TabIndex = 23;
this.label2.Text = "用户名";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtDescript
//
this.txtDescript.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtDescript.Location = new System.Drawing.Point(88, 112);
this.txtDescript.Name = "txtDescript";
this.txtDescript.Size = new System.Drawing.Size(560, 21);
this.txtDescript.TabIndex = 32;
this.txtDescript.Text = "";
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 9F);
this.label6.Location = new System.Drawing.Point(24, 112);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(72, 23);
this.label6.TabIndex = 30;
this.label6.Text = "服务描述";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// panel1
//
this.panel1.Controls.Add(this.cobLevel);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.dgMenu);
this.panel1.Controls.Add(this.txtTelnumber);
this.panel1.Controls.Add(this.label9);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.txtPwdC);
this.panel1.Controls.Add(this.txtPwd);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.txtMenu);
this.panel1.Controls.Add(this.btDelete);
this.panel1.Controls.Add(this.btSave);
this.panel1.Controls.Add(this.btAdd);
this.panel1.Controls.Add(this.btReset);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.txtDescript);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.txtId);
this.panel1.Controls.Add(this.txtLogin);
this.panel1.Controls.Add(this.txtname);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(808, 184);
this.panel1.TabIndex = 4;
//
// UserManage
//
this.AutoScroll = true;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.gridDataFilter1);
this.Name = "UserManage";
this.Size = new System.Drawing.Size(808, 525);
this.Load += new System.EventHandler(this.UserManage_Load);
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgUser)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgMenu)).EndInit();
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void dtAdd_Click(object sender, System.EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
this.btAdd.Enabled = false;
insertData();
this.btAdd.Enabled = true;
this.Cursor = Cursors.Arrow;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void getDataBind()
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -