?? frmrolemanage.cs
字號:
using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ExamCenter.BLCTier;
namespace ExamCenter.FormTier
{
/// <summary>System.Windows.Forms.Form
/// FrmRoleManage 的摘要說明。FrmOpperateLog
/// </summary>
public class FrmRoleManage : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dgRoles;
private System.Windows.Forms.Label lblRoleName;
private System.Windows.Forms.Label lblRoleDescription;
private System.Windows.Forms.TextBox txtRoleName;
private System.Windows.Forms.TextBox txtRoleDescription;
private System.Windows.Forms.Button btnAddRole;
private System.Windows.Forms.Button btnDelRole;
private System.Windows.Forms.Button btnSave;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
//角色數據集
private DataSet dsRole;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblExit;
private System.Windows.Forms.Button btnEdit;
//角色表
private DataTable dtRole;
private enum BtnClick{AddClick,DelClick,EditClick,SaveClick};
private BtnClick btnClick = BtnClick.SaveClick;
private DataRow drCurrent;
public FrmRoleManage()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//選出數據集與窗體數據網格綁定
MakeBind();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRoleManage));
this.dgRoles = new System.Windows.Forms.DataGrid();
this.lblRoleName = new System.Windows.Forms.Label();
this.lblRoleDescription = new System.Windows.Forms.Label();
this.txtRoleName = new System.Windows.Forms.TextBox();
this.txtRoleDescription = new System.Windows.Forms.TextBox();
this.btnAddRole = new System.Windows.Forms.Button();
this.btnDelRole = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.lblExit = new System.Windows.Forms.Label();
this.btnEdit = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgRoles)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// dgRoles
//
this.dgRoles.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgRoles.CaptionVisible = false;
this.dgRoles.DataMember = "";
this.dgRoles.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgRoles.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgRoles.Location = new System.Drawing.Point(3, 17);
this.dgRoles.Name = "dgRoles";
this.dgRoles.ReadOnly = true;
this.dgRoles.Size = new System.Drawing.Size(506, 196);
this.dgRoles.TabIndex = 0;
this.dgRoles.CurrentCellChanged += new System.EventHandler(this.dgRoles_CurrentCellChanged);
//
// lblRoleName
//
this.lblRoleName.Location = new System.Drawing.Point(8, 24);
this.lblRoleName.Name = "lblRoleName";
this.lblRoleName.Size = new System.Drawing.Size(64, 23);
this.lblRoleName.TabIndex = 1;
this.lblRoleName.Text = " 角色名:";
this.lblRoleName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblRoleDescription
//
this.lblRoleDescription.Location = new System.Drawing.Point(232, 24);
this.lblRoleDescription.Name = "lblRoleDescription";
this.lblRoleDescription.Size = new System.Drawing.Size(72, 23);
this.lblRoleDescription.TabIndex = 2;
this.lblRoleDescription.Text = " 角色描述:";
this.lblRoleDescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtRoleName
//
this.txtRoleName.Location = new System.Drawing.Point(72, 24);
this.txtRoleName.MaxLength = 25;
this.txtRoleName.Multiline = true;
this.txtRoleName.Name = "txtRoleName";
this.txtRoleName.Size = new System.Drawing.Size(120, 21);
this.txtRoleName.TabIndex = 3;
//
// txtRoleDescription
//
this.txtRoleDescription.Location = new System.Drawing.Point(304, 24);
this.txtRoleDescription.MaxLength = 25;
this.txtRoleDescription.Multiline = true;
this.txtRoleDescription.Name = "txtRoleDescription";
this.txtRoleDescription.Size = new System.Drawing.Size(128, 21);
this.txtRoleDescription.TabIndex = 4;
//
// btnAddRole
//
this.btnAddRole.BackColor = System.Drawing.Color.Transparent;
this.btnAddRole.Location = new System.Drawing.Point(24, 320);
this.btnAddRole.Name = "btnAddRole";
this.btnAddRole.Size = new System.Drawing.Size(64, 23);
this.btnAddRole.TabIndex = 5;
this.btnAddRole.Text = "增加";
this.btnAddRole.UseVisualStyleBackColor = false;
this.btnAddRole.Click += new System.EventHandler(this.btnAddRole_Click);
//
// btnDelRole
//
this.btnDelRole.BackColor = System.Drawing.Color.Transparent;
this.btnDelRole.Location = new System.Drawing.Point(232, 320);
this.btnDelRole.Name = "btnDelRole";
this.btnDelRole.Size = new System.Drawing.Size(64, 23);
this.btnDelRole.TabIndex = 6;
this.btnDelRole.Text = "刪除";
this.btnDelRole.UseVisualStyleBackColor = false;
this.btnDelRole.Click += new System.EventHandler(this.btnDelRole_Click);
//
// btnSave
//
this.btnSave.BackColor = System.Drawing.Color.Transparent;
this.btnSave.Location = new System.Drawing.Point(336, 320);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(64, 23);
this.btnSave.TabIndex = 7;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = false;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.dgRoles);
this.groupBox1.Location = new System.Drawing.Point(8, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(512, 216);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "角色列表";
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.Transparent;
this.groupBox2.Controls.Add(this.lblRoleName);
this.groupBox2.Controls.Add(this.txtRoleName);
this.groupBox2.Controls.Add(this.txtRoleDescription);
this.groupBox2.Controls.Add(this.lblRoleDescription);
this.groupBox2.Location = new System.Drawing.Point(16, 248);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(496, 56);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "角色詳細信息";
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(232, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(96, 23);
this.label1.TabIndex = 11;
this.label1.Text = "角 色 管 理";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
//
// lblExit
//
this.lblExit.BackColor = System.Drawing.Color.Transparent;
this.lblExit.Location = new System.Drawing.Point(504, 0);
this.lblExit.Name = "lblExit";
this.lblExit.Size = new System.Drawing.Size(16, 24);
this.lblExit.TabIndex = 12;
this.lblExit.TextAlign = System.Drawing.ContentAlignment.BottomRight;
this.lblExit.Click += new System.EventHandler(this.lblExit_Click);
//
// btnEdit
//
this.btnEdit.BackColor = System.Drawing.Color.Transparent;
this.btnEdit.Location = new System.Drawing.Point(128, 320);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(64, 23);
this.btnEdit.TabIndex = 13;
this.btnEdit.Text = "編輯";
this.btnEdit.UseVisualStyleBackColor = false;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
//
// FrmRoleManage
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(523, 357);
this.Controls.Add(this.btnEdit);
this.Controls.Add(this.lblExit);
this.Controls.Add(this.label1);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -