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

📄 newemployee.cs

📁 分布试数据库系统的管理员程序
💻 CS
📖 第 1 页 / 共 3 页
字号:
			// 
			// gbInput
			// 
			this.gbInput.BackColor = System.Drawing.Color.Transparent;
			this.gbInput.Controls.Add(this.cbBranch);
			this.gbInput.Controls.Add(this.label5);
			this.gbInput.Controls.Add(this.cbKind);
			this.gbInput.Controls.Add(this.cbGender);
			this.gbInput.Controls.Add(this.tbName);
			this.gbInput.Controls.Add(this.tbPhone);
			this.gbInput.Controls.Add(this.label1);
			this.gbInput.Controls.Add(this.label2);
			this.gbInput.Controls.Add(this.label3);
			this.gbInput.Controls.Add(this.label4);
			this.gbInput.Location = new System.Drawing.Point(144, 128);
			this.gbInput.Name = "gbInput";
			this.gbInput.Size = new System.Drawing.Size(256, 224);
			this.gbInput.TabIndex = 10;
			this.gbInput.TabStop = false;
			// 
			// cbBranch
			// 
			this.cbBranch.Items.AddRange(new object[] {
														  "总店",
														  "分店1",
														  "分店2"});
			this.cbBranch.Location = new System.Drawing.Point(104, 176);
			this.cbBranch.Name = "cbBranch";
			this.cbBranch.Size = new System.Drawing.Size(121, 20);
			this.cbBranch.TabIndex = 3;
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(32, 184);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(64, 23);
			this.label5.TabIndex = 2;
			this.label5.Text = "所在分店:";
			// 
			// cbKind
			// 
			this.cbKind.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbKind.Items.AddRange(new object[] {
														"管理员",
														"营业员"});
			this.cbKind.Location = new System.Drawing.Point(104, 96);
			this.cbKind.Name = "cbKind";
			this.cbKind.Size = new System.Drawing.Size(121, 20);
			this.cbKind.TabIndex = 1;
			// 
			// cbGender
			// 
			this.cbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbGender.Items.AddRange(new object[] {
														  "男",
														  "女"});
			this.cbGender.Location = new System.Drawing.Point(104, 56);
			this.cbGender.Name = "cbGender";
			this.cbGender.Size = new System.Drawing.Size(121, 20);
			this.cbGender.TabIndex = 0;
			// 
			// sqlConnection_Staff
			// 
			this.sqlConnection_Staff.ConnectionString = "workstation id=7B1EE60547FB453;packet size=4096;user id=sa;integrated security=SS" +
				"PI;initial catalog=Center;persist security info=False";
			// 
			// sqlDataAdapter_Staff
			// 
			this.sqlDataAdapter_Staff.DeleteCommand = this.sqlDeleteCommand3;
			this.sqlDataAdapter_Staff.InsertCommand = this.sqlInsertCommand1;
			this.sqlDataAdapter_Staff.SelectCommand = this.sqlSelectCommand1;
			this.sqlDataAdapter_Staff.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																										   new System.Data.Common.DataTableMapping("Table", "Staff", new System.Data.Common.DataColumnMapping[] {
																																																					new System.Data.Common.DataColumnMapping("staffid", "staffid"),
																																																					new System.Data.Common.DataColumnMapping("branch", "branch"),
																																																					new System.Data.Common.DataColumnMapping("branchid", "branchid"),
																																																					new System.Data.Common.DataColumnMapping("staffname", "staffname"),
																																																					new System.Data.Common.DataColumnMapping("gender", "gender"),
																																																					new System.Data.Common.DataColumnMapping("staffkind", "staffkind"),
																																																					new System.Data.Common.DataColumnMapping("salary", "salary"),
																																																					new System.Data.Common.DataColumnMapping("staffphone", "staffphone")})});
			this.sqlDataAdapter_Staff.UpdateCommand = this.sqlUpdateCommand3;
			// 
			// sqlDataAdapter_SysUser
			// 
			this.sqlDataAdapter_SysUser.DeleteCommand = this.sqlDeleteCommand2;
			this.sqlDataAdapter_SysUser.InsertCommand = this.sqlInsertCommand2;
			this.sqlDataAdapter_SysUser.SelectCommand = this.sqlSelectCommand2;
			this.sqlDataAdapter_SysUser.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																											 new System.Data.Common.DataTableMapping("Table", "SystemUser", new System.Data.Common.DataColumnMapping[] {
																																																						   new System.Data.Common.DataColumnMapping("userid", "userid"),
																																																						   new System.Data.Common.DataColumnMapping("password", "password"),
																																																						   new System.Data.Common.DataColumnMapping("staffkind", "staffkind")})});
			this.sqlDataAdapter_SysUser.UpdateCommand = this.sqlUpdateCommand2;
			// 
			// dataSet_Staff
			// 
			this.dataSet_Staff.DataSetName = "NewDataSet";
			this.dataSet_Staff.Locale = new System.Globalization.CultureInfo("zh-CN");
			this.dataSet_Staff.Tables.AddRange(new System.Data.DataTable[] {
																			   this.Staff});
			// 
			// Staff
			// 
			this.Staff.TableName = "Staff";
			// 
			// dataSet_SysUser
			// 
			this.dataSet_SysUser.DataSetName = "NewDataSet";
			this.dataSet_SysUser.Locale = new System.Globalization.CultureInfo("zh-CN");
			// 
			// sqlDataAdapter_Branch
			// 
			this.sqlDataAdapter_Branch.DeleteCommand = this.sqlDeleteCommand1;
			this.sqlDataAdapter_Branch.InsertCommand = this.sqlInsertCommand3;
			this.sqlDataAdapter_Branch.SelectCommand = this.sqlSelectCommand3;
			this.sqlDataAdapter_Branch.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																											new System.Data.Common.DataTableMapping("Table", "Branch", new System.Data.Common.DataColumnMapping[] {
																																																					  new System.Data.Common.DataColumnMapping("branchid", "branchid"),
																																																					  new System.Data.Common.DataColumnMapping("ip", "ip")})});
			this.sqlDataAdapter_Branch.UpdateCommand = this.sqlUpdateCommand1;
			// 
			// sqlSelectCommand2
			// 
			this.sqlSelectCommand2.CommandText = "SELECT userid, password, staffkind FROM SystemUser";
			this.sqlSelectCommand2.Connection = this.sqlConnection_Staff;
			// 
			// sqlInsertCommand2
			// 
			this.sqlInsertCommand2.CommandText = "INSERT INTO SystemUser(userid, password, staffkind) VALUES (@userid, @password, @" +
				"staffkind); SELECT userid, password, staffkind FROM SystemUser WHERE (userid = @" +
				"userid)";
			this.sqlInsertCommand2.Connection = this.sqlConnection_Staff;
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@userid", System.Data.SqlDbType.Int, 4, "userid"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@password", System.Data.SqlDbType.VarChar, 10, "password"));
			this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffkind", System.Data.SqlDbType.VarChar, 50, "staffkind"));
			// 
			// sqlUpdateCommand2
			// 
			this.sqlUpdateCommand2.CommandText = @"UPDATE SystemUser SET userid = @userid, password = @password, staffkind = @staffkind WHERE (userid = @Original_userid) AND (password = @Original_password) AND (staffkind = @Original_staffkind); SELECT userid, password, staffkind FROM SystemUser WHERE (userid = @userid)";
			this.sqlUpdateCommand2.Connection = this.sqlConnection_Staff;
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@userid", System.Data.SqlDbType.Int, 4, "userid"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@password", System.Data.SqlDbType.VarChar, 10, "password"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffkind", System.Data.SqlDbType.VarChar, 50, "staffkind"));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_userid", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "userid", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_password", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "password", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_staffkind", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "staffkind", System.Data.DataRowVersion.Original, null));
			// 
			// sqlDeleteCommand2
			// 
			this.sqlDeleteCommand2.CommandText = "DELETE FROM SystemUser WHERE (userid = @Original_userid) AND (password = @Origina" +
				"l_password) AND (staffkind = @Original_staffkind)";
			this.sqlDeleteCommand2.Connection = this.sqlConnection_Staff;
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_userid", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "userid", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_password", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "password", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_staffkind", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "staffkind", System.Data.DataRowVersion.Original, null));
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT staffid, branch, branchid, staffname, gender, staffkind, salary, staffphon" +
				"e FROM Staff";
			this.sqlSelectCommand1.Connection = this.sqlConnection_Staff;
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = @"INSERT INTO Staff(staffid, branch, branchid, staffname, gender, staffkind, salary, staffphone) VALUES (@staffid, @branch, @branchid, @staffname, @gender, @staffkind, @salary, @staffphone); SELECT staffid, branch, branchid, staffname, gender, staffkind, salary, staffphone FROM Staff WHERE (staffid = @staffid)";
			this.sqlInsertCommand1.Connection = this.sqlConnection_Staff;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffid", System.Data.SqlDbType.Int, 4, "staffid"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@branch", System.Data.SqlDbType.VarChar, 10, "branch"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@branchid", System.Data.SqlDbType.Int, 4, "branchid"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffname", System.Data.SqlDbType.VarChar, 50, "staffname"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@gender", System.Data.SqlDbType.VarChar, 2, "gender"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffkind", System.Data.SqlDbType.VarChar, 50, "staffkind"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@salary", System.Data.SqlDbType.VarChar, 10, "salary"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffphone", System.Data.SqlDbType.VarChar, 50, "staffphone"));
			// 
			// sqlUpdateCommand3
			// 
			this.sqlUpdateCommand3.CommandText = @"UPDATE Staff SET staffid = @staffid, branch = @branch, branchid = @branchid, staffname = @staffname, gender = @gender, staffkind = @staffkind, salary = @salary, staffphone = @staffphone WHERE (staffid = @Original_staffid) AND (branch = @Original_branch OR @Original_branch IS NULL AND branch IS NULL) AND (branchid = @Original_branchid OR @Original_branchid IS NULL AND branchid IS NULL) AND (gender = @Original_gender OR @Original_gender IS NULL AND gender IS NULL) AND (salary = @Original_salary OR @Original_salary IS NULL AND salary IS NULL) AND (staffkind = @Original_staffkind OR @Original_staffkind IS NULL AND staffkind IS NULL) AND (staffname = @Original_staffname OR @Original_staffname IS NULL AND staffname IS NULL) AND (staffphone = @Original_staffphone OR @Original_staffphone IS NULL AND staffphone IS NULL); SELECT staffid, branch, branchid, staffname, gender, staffkind, salary, staffphone FROM Staff WHERE (staffid = @staffid)";
			this.sqlUpdateCommand3.Connection = this.sqlConnection_Staff;
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffid", System.Data.SqlDbType.Int, 4, "staffid"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@branch", System.Data.SqlDbType.VarChar, 10, "branch"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@branchid", System.Data.SqlDbType.Int, 4, "branchid"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffname", System.Data.SqlDbType.VarChar, 50, "staffname"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@gender", System.Data.SqlDbType.VarChar, 2, "gender"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffkind", System.Data.SqlDbType.VarChar, 50, "staffkind"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@salary", System.Data.SqlDbType.VarChar, 10, "salary"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@staffphone", System.Data.SqlDbType.VarChar, 50, "staffphone"));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_staffid", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "staffid", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_branch", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "branch", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_branchid", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "branchid", System.Data.DataRowVersion.Original, null));

⌨️ 快捷键说明

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