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

📄 bankmanageform.cs

📁 银行数据库的操作人员管理平台,主要对操作的柜员帐号进行管理,C#+SQL开发
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace BankManage
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class BankManageForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TabPage CreateOperAccount;
		private System.Windows.Forms.TabPage ModifyOperAccount;
		private System.Windows.Forms.TabPage ListOperAccount;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Button btnCreateAccount;
		private System.Windows.Forms.TextBox txtName;
		private System.Windows.Forms.TextBox txtWorkID;
		private System.Windows.Forms.TextBox txtAccount;
		private System.Windows.Forms.TextBox txtPassword;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.RadioButton btnReadWrite;
		private System.Windows.Forms.RadioButton btnList;
		private System.Data.SqlClient.SqlConnection sqlConnection;
		private System.Data.SqlClient.SqlCommand sqlCommand;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.TextBox txtAccQuery;
		private System.Windows.Forms.Button btnQuery;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.RadioButton btnModifyList;
		private System.Windows.Forms.RadioButton btnModifyRW;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.TextBox txtModifyPwd;
		private System.Windows.Forms.TextBox txtModifyWorkID;
		private System.Windows.Forms.TextBox txtModifyName;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Button btnModify;
		private System.Windows.Forms.Button btnDelete;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
		private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
		private System.Data.DataSet dataSet;
		private System.Windows.Forms.TabControl tabControl;
		private System.Windows.Forms.DataGrid dataGrid;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public BankManageForm()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
			//在窗体生成一开始,必须打开SQL连接,以后才能进行数据库的操作
			sqlConnection.Open();
		}

		/// <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.tabControl = new System.Windows.Forms.TabControl();
			this.CreateOperAccount = new System.Windows.Forms.TabPage();
			this.btnList = new System.Windows.Forms.RadioButton();
			this.btnReadWrite = new System.Windows.Forms.RadioButton();
			this.label5 = new System.Windows.Forms.Label();
			this.txtPassword = new System.Windows.Forms.TextBox();
			this.txtAccount = new System.Windows.Forms.TextBox();
			this.txtWorkID = new System.Windows.Forms.TextBox();
			this.txtName = new System.Windows.Forms.TextBox();
			this.btnCreateAccount = new System.Windows.Forms.Button();
			this.label4 = 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.ModifyOperAccount = new System.Windows.Forms.TabPage();
			this.btnDelete = new System.Windows.Forms.Button();
			this.btnModify = new System.Windows.Forms.Button();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.btnModifyList = new System.Windows.Forms.RadioButton();
			this.btnModifyRW = new System.Windows.Forms.RadioButton();
			this.label8 = new System.Windows.Forms.Label();
			this.txtModifyPwd = new System.Windows.Forms.TextBox();
			this.txtModifyWorkID = new System.Windows.Forms.TextBox();
			this.txtModifyName = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.btnQuery = new System.Windows.Forms.Button();
			this.txtAccQuery = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.ListOperAccount = new System.Windows.Forms.TabPage();
			this.sqlConnection = new System.Data.SqlClient.SqlConnection();
			this.sqlCommand = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
			this.dataSet = new System.Data.DataSet();
			this.dataGrid = new System.Windows.Forms.DataGrid();
			this.tabControl.SuspendLayout();
			this.CreateOperAccount.SuspendLayout();
			this.ModifyOperAccount.SuspendLayout();
			this.groupBox1.SuspendLayout();
			this.ListOperAccount.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dataSet)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
			this.SuspendLayout();
			// 
			// tabControl
			// 
			this.tabControl.Controls.Add(this.CreateOperAccount);
			this.tabControl.Controls.Add(this.ModifyOperAccount);
			this.tabControl.Controls.Add(this.ListOperAccount);
			this.tabControl.Location = new System.Drawing.Point(16, 40);
			this.tabControl.Name = "tabControl";
			this.tabControl.SelectedIndex = 0;
			this.tabControl.Size = new System.Drawing.Size(504, 256);
			this.tabControl.TabIndex = 0;
			this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
			// 
			// CreateOperAccount
			// 
			this.CreateOperAccount.Controls.Add(this.btnList);
			this.CreateOperAccount.Controls.Add(this.btnReadWrite);
			this.CreateOperAccount.Controls.Add(this.label5);
			this.CreateOperAccount.Controls.Add(this.txtPassword);
			this.CreateOperAccount.Controls.Add(this.txtAccount);
			this.CreateOperAccount.Controls.Add(this.txtWorkID);
			this.CreateOperAccount.Controls.Add(this.txtName);
			this.CreateOperAccount.Controls.Add(this.btnCreateAccount);
			this.CreateOperAccount.Controls.Add(this.label4);
			this.CreateOperAccount.Controls.Add(this.label3);
			this.CreateOperAccount.Controls.Add(this.label2);
			this.CreateOperAccount.Controls.Add(this.label1);
			this.CreateOperAccount.Location = new System.Drawing.Point(4, 21);
			this.CreateOperAccount.Name = "CreateOperAccount";
			this.CreateOperAccount.Size = new System.Drawing.Size(496, 231);
			this.CreateOperAccount.TabIndex = 0;
			this.CreateOperAccount.Text = "创建帐号";
			// 
			// btnList
			// 
			this.btnList.Location = new System.Drawing.Point(360, 96);
			this.btnList.Name = "btnList";
			this.btnList.TabIndex = 11;
			this.btnList.Text = "列表";
			// 
			// btnReadWrite
			// 
			this.btnReadWrite.Location = new System.Drawing.Point(360, 56);
			this.btnReadWrite.Name = "btnReadWrite";
			this.btnReadWrite.TabIndex = 10;
			this.btnReadWrite.Text = "读写";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(336, 24);
			this.label5.Name = "label5";
			this.label5.TabIndex = 9;
			this.label5.Text = "权限:";
			// 
			// txtPassword
			// 
			this.txtPassword.Location = new System.Drawing.Point(136, 136);
			this.txtPassword.Name = "txtPassword";
			this.txtPassword.Size = new System.Drawing.Size(168, 21);
			this.txtPassword.TabIndex = 8;
			this.txtPassword.Text = "";
			// 
			// txtAccount
			// 
			this.txtAccount.Location = new System.Drawing.Point(136, 96);
			this.txtAccount.Name = "txtAccount";
			this.txtAccount.Size = new System.Drawing.Size(168, 21);
			this.txtAccount.TabIndex = 7;
			this.txtAccount.Text = "";
			// 
			// txtWorkID
			// 
			this.txtWorkID.Location = new System.Drawing.Point(136, 64);
			this.txtWorkID.Name = "txtWorkID";
			this.txtWorkID.Size = new System.Drawing.Size(168, 21);
			this.txtWorkID.TabIndex = 6;
			this.txtWorkID.Text = "";
			// 
			// txtName
			// 
			this.txtName.Location = new System.Drawing.Point(136, 24);
			this.txtName.Name = "txtName";
			this.txtName.Size = new System.Drawing.Size(168, 21);
			this.txtName.TabIndex = 5;
			this.txtName.Text = "";
			// 
			// btnCreateAccount
			// 
			this.btnCreateAccount.Location = new System.Drawing.Point(152, 192);
			this.btnCreateAccount.Name = "btnCreateAccount";
			this.btnCreateAccount.Size = new System.Drawing.Size(96, 32);
			this.btnCreateAccount.TabIndex = 4;
			this.btnCreateAccount.Text = "添加";
			this.btnCreateAccount.Click += new System.EventHandler(this.btnCreateAccount_Click);
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(24, 144);
			this.label4.Name = "label4";
			this.label4.TabIndex = 3;
			this.label4.Text = "操作帐号密码:";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(24, 104);
			this.label3.Name = "label3";
			this.label3.TabIndex = 2;
			this.label3.Text = "操作帐号:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(24, 64);
			this.label2.Name = "label2";
			this.label2.TabIndex = 1;
			this.label2.Text = "操作人工号:";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 24);
			this.label1.Name = "label1";
			this.label1.TabIndex = 0;
			this.label1.Text = "操作人:";
			// 
			// ModifyOperAccount
			// 
			this.ModifyOperAccount.Controls.Add(this.btnDelete);
			this.ModifyOperAccount.Controls.Add(this.btnModify);
			this.ModifyOperAccount.Controls.Add(this.groupBox1);
			this.ModifyOperAccount.Controls.Add(this.btnQuery);
			this.ModifyOperAccount.Controls.Add(this.txtAccQuery);
			this.ModifyOperAccount.Controls.Add(this.label6);
			this.ModifyOperAccount.Location = new System.Drawing.Point(4, 21);
			this.ModifyOperAccount.Name = "ModifyOperAccount";
			this.ModifyOperAccount.Size = new System.Drawing.Size(496, 231);
			this.ModifyOperAccount.TabIndex = 1;
			this.ModifyOperAccount.Text = "修改帐号";
			// 
			// btnDelete
			// 
			this.btnDelete.Location = new System.Drawing.Point(312, 192);
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.TabIndex = 5;
			this.btnDelete.Text = "删除帐号";
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// btnModify
			// 
			this.btnModify.Location = new System.Drawing.Point(96, 192);
			this.btnModify.Name = "btnModify";
			this.btnModify.TabIndex = 4;
			this.btnModify.Text = "修改";
			this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.btnModifyList);
			this.groupBox1.Controls.Add(this.btnModifyRW);
			this.groupBox1.Controls.Add(this.label8);
			this.groupBox1.Controls.Add(this.txtModifyPwd);
			this.groupBox1.Controls.Add(this.txtModifyWorkID);
			this.groupBox1.Controls.Add(this.txtModifyName);
			this.groupBox1.Controls.Add(this.label9);
			this.groupBox1.Controls.Add(this.label10);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Location = new System.Drawing.Point(16, 56);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(464, 120);
			this.groupBox1.TabIndex = 3;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "修改内容:";
			// 
			// btnModifyList
			// 
			this.btnModifyList.Location = new System.Drawing.Point(352, 88);
			this.btnModifyList.Name = "btnModifyList";
			this.btnModifyList.TabIndex = 19;
			this.btnModifyList.Text = "列表";
			// 
			// btnModifyRW
			// 
			this.btnModifyRW.Location = new System.Drawing.Point(352, 56);
			this.btnModifyRW.Name = "btnModifyRW";
			this.btnModifyRW.TabIndex = 18;
			this.btnModifyRW.Text = "读写";
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(352, 24);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -