⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmrolemanage.cs

📁 一个好的系统 对初学者很有用啊 来看看啊
💻 CS
📖 第 1 页 / 共 2 页
字号:
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 + -