AmendStafferInfo.cs
资源名称:VCSDB.rar [点击查看]
上传用户:hjieqiu
上传日期:2013-05-11
资源大小:16494k
文件大小:57k
源码类别:
企业管理
开发平台:
C#
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
- using System.Data.SqlClient;
- namespace 人力资源管理系统
- {
- /// <summary>
- /// AmendStafferInfo 的摘要说明。
- /// </summary>
- public class AmendStafferInfo : System.Windows.Forms.Form
- {
- private DataTable tempTable = new DataTable();
- private CurrencyManager cmAmend;
- private string strSQL = "";
- private SqlConnection tempConnection = new SqlConnection("workstation id=localhost;database=hrmbook;Connect Timeout=30;Trusted_Connection=yes") ;
- private SqlDataAdapter da;
- private DataTable tblDataSource = new DataTable();
- private System.Windows.Forms.DataGrid dataGrid1;
- private System.Windows.Forms.GroupBox groupBox1;
- 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.Label label5;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label label15;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.Label label17;
- private System.Windows.Forms.Label label18;
- private System.Windows.Forms.Label label19;
- private System.Windows.Forms.Label label21;
- private System.Windows.Forms.TextBox txt1;
- private System.Windows.Forms.TextBox txt2;
- private System.Windows.Forms.TextBox txt3;
- private System.Windows.Forms.ComboBox cmb1;
- private System.Windows.Forms.ComboBox cmb3;
- private System.Windows.Forms.ComboBox cmb2;
- private System.Windows.Forms.ComboBox cmb4;
- private System.Windows.Forms.TextBox txt6;
- private System.Windows.Forms.TextBox txt5;
- private System.Windows.Forms.TextBox txt8;
- private System.Windows.Forms.TextBox txt4;
- private System.Windows.Forms.TextBox txt7;
- private System.Windows.Forms.TextBox txt10;
- private System.Windows.Forms.TextBox txt9;
- private System.Windows.Forms.TextBox txt12;
- private System.Windows.Forms.TextBox txt11;
- private System.Windows.Forms.TextBox txt15;
- private System.Windows.Forms.TextBox txt13;
- private System.Windows.Forms.TextBox txt16;
- private System.Windows.Forms.TextBox txt14;
- private System.Windows.Forms.ToolBar toolBar1;
- private System.Windows.Forms.ToolBarButton tbarBtnDelete;
- private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
- private System.Windows.Forms.ToolBarButton tbarBtnNew;
- private System.Windows.Forms.ImageList imageList1;
- private System.Windows.Forms.ToolBarButton toolBarPre;
- private System.Windows.Forms.ToolBarButton toolBarNext;
- private System.Windows.Forms.ToolBarButton toolBarSubmit;
- private System.Windows.Forms.Label label20;
- private System.Windows.Forms.TextBox txt17;
- private System.Windows.Forms.ToolBarButton toolBarFirst;
- private System.Windows.Forms.ToolBarButton toolBarLast;
- private System.Windows.Forms.ToolBarButton toolBarQuit;
- private System.Windows.Forms.ToolBarButton toolBarCancel;
- 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.SqlConnection sqlConnection2;
- private System.ComponentModel.IContainer components;
- public AmendStafferInfo()
- {
- //
- // 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.components = new System.ComponentModel.Container();
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AmendStafferInfo));
- this.dataGrid1 = new System.Windows.Forms.DataGrid();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.txt17 = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.cmb1 = new System.Windows.Forms.ComboBox();
- this.txt12 = new System.Windows.Forms.TextBox();
- this.txt6 = new System.Windows.Forms.TextBox();
- this.txt11 = new System.Windows.Forms.TextBox();
- this.txt15 = new System.Windows.Forms.TextBox();
- this.txt13 = new System.Windows.Forms.TextBox();
- this.txt16 = new System.Windows.Forms.TextBox();
- this.txt5 = new System.Windows.Forms.TextBox();
- this.txt10 = new System.Windows.Forms.TextBox();
- this.txt14 = new System.Windows.Forms.TextBox();
- this.txt1 = new System.Windows.Forms.TextBox();
- this.txt2 = new System.Windows.Forms.TextBox();
- this.txt9 = new System.Windows.Forms.TextBox();
- this.txt8 = new System.Windows.Forms.TextBox();
- this.txt4 = new System.Windows.Forms.TextBox();
- this.txt3 = new System.Windows.Forms.TextBox();
- this.txt7 = new System.Windows.Forms.TextBox();
- this.cmb3 = new System.Windows.Forms.ComboBox();
- this.cmb2 = new System.Windows.Forms.ComboBox();
- this.cmb4 = new System.Windows.Forms.ComboBox();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.label11 = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.label13 = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.label17 = new System.Windows.Forms.Label();
- this.label18 = new System.Windows.Forms.Label();
- this.label19 = new System.Windows.Forms.Label();
- this.label21 = new System.Windows.Forms.Label();
- this.label20 = new System.Windows.Forms.Label();
- this.toolBar1 = new System.Windows.Forms.ToolBar();
- this.toolBarFirst = new System.Windows.Forms.ToolBarButton();
- this.toolBarPre = new System.Windows.Forms.ToolBarButton();
- this.toolBarNext = new System.Windows.Forms.ToolBarButton();
- this.toolBarLast = new System.Windows.Forms.ToolBarButton();
- this.tbarBtnNew = new System.Windows.Forms.ToolBarButton();
- this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
- this.toolBarSubmit = new System.Windows.Forms.ToolBarButton();
- this.toolBarCancel = new System.Windows.Forms.ToolBarButton();
- this.toolBarQuit = new System.Windows.Forms.ToolBarButton();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
- this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
- this.sqlConnection2 = new System.Data.SqlClient.SqlConnection();
- this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
- this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
- this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
- ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
- this.groupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // dataGrid1
- //
- this.dataGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.dataGrid1.CaptionVisible = false;
- this.dataGrid1.DataMember = "";
- this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
- this.dataGrid1.Location = new System.Drawing.Point(0, 40);
- this.dataGrid1.Name = "dataGrid1";
- this.dataGrid1.Size = new System.Drawing.Size(642, 152);
- this.dataGrid1.TabIndex = 21;
- this.dataGrid1.CurrentCellChanged += new System.EventHandler(this.dataGrid1_CurrentCellChanged);
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.txt17);
- this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Controls.Add(this.cmb1);
- this.groupBox1.Controls.Add(this.txt12);
- this.groupBox1.Controls.Add(this.txt6);
- this.groupBox1.Controls.Add(this.txt11);
- this.groupBox1.Controls.Add(this.txt15);
- this.groupBox1.Controls.Add(this.txt13);
- this.groupBox1.Controls.Add(this.txt16);
- this.groupBox1.Controls.Add(this.txt5);
- this.groupBox1.Controls.Add(this.txt10);
- this.groupBox1.Controls.Add(this.txt14);
- this.groupBox1.Controls.Add(this.txt1);
- this.groupBox1.Controls.Add(this.txt2);
- this.groupBox1.Controls.Add(this.txt9);
- this.groupBox1.Controls.Add(this.txt8);
- this.groupBox1.Controls.Add(this.txt4);
- this.groupBox1.Controls.Add(this.txt3);
- this.groupBox1.Controls.Add(this.txt7);
- this.groupBox1.Controls.Add(this.cmb3);
- this.groupBox1.Controls.Add(this.cmb2);
- this.groupBox1.Controls.Add(this.cmb4);
- this.groupBox1.Controls.Add(this.label2);
- this.groupBox1.Controls.Add(this.label3);
- this.groupBox1.Controls.Add(this.label4);
- this.groupBox1.Controls.Add(this.label5);
- this.groupBox1.Controls.Add(this.label6);
- this.groupBox1.Controls.Add(this.label7);
- this.groupBox1.Controls.Add(this.label8);
- this.groupBox1.Controls.Add(this.label9);
- this.groupBox1.Controls.Add(this.label10);
- this.groupBox1.Controls.Add(this.label11);
- this.groupBox1.Controls.Add(this.label12);
- this.groupBox1.Controls.Add(this.label13);
- this.groupBox1.Controls.Add(this.label14);
- this.groupBox1.Controls.Add(this.label15);
- this.groupBox1.Controls.Add(this.label16);
- this.groupBox1.Controls.Add(this.label17);
- this.groupBox1.Controls.Add(this.label18);
- this.groupBox1.Controls.Add(this.label19);
- this.groupBox1.Controls.Add(this.label21);
- this.groupBox1.Controls.Add(this.label20);
- this.groupBox1.Location = new System.Drawing.Point(0, 192);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(642, 272);
- this.groupBox1.TabIndex = 2;
- this.groupBox1.TabStop = false;
- //
- // txt17
- //
- this.txt17.Enabled = false;
- this.txt17.Location = new System.Drawing.Point(464, 216);
- this.txt17.Name = "txt17";
- this.txt17.ReadOnly = true;
- this.txt17.Size = new System.Drawing.Size(160, 21);
- this.txt17.TabIndex = 20;
- this.txt17.Text = "";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(528, 136);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(64, 16);
- this.label1.TabIndex = 19;
- this.label1.Text = "手机号码";
- //
- // cmb1
- //
- this.cmb1.Items.AddRange(new object[] {
- "男",
- "女"});
- this.cmb1.Location = new System.Drawing.Point(272, 43);
- this.cmb1.Name = "cmb1";
- this.cmb1.Size = new System.Drawing.Size(64, 20);
- this.cmb1.TabIndex = 3;
- //
- // txt12
- //
- this.txt12.Location = new System.Drawing.Point(528, 160);
- this.txt12.Name = "txt12";
- this.txt12.Size = new System.Drawing.Size(96, 21);
- this.txt12.TabIndex = 14;
- this.txt12.Text = "";
- //
- // txt6
- //
- this.txt6.Location = new System.Drawing.Point(240, 101);
- this.txt6.Name = "txt6";
- this.txt6.Size = new System.Drawing.Size(128, 21);
- this.txt6.TabIndex = 8;
- this.txt6.Text = "";
- //
- // txt11
- //
- this.txt11.Location = new System.Drawing.Point(320, 158);
- this.txt11.Name = "txt11";
- this.txt11.TabIndex = 13;
- this.txt11.Text = "";
- //
- // txt15
- //
- this.txt15.Location = new System.Drawing.Point(240, 216);
- this.txt15.Name = "txt15";
- this.txt15.TabIndex = 17;
- this.txt15.Text = "";
- //
- // txt13
- //
- this.txt13.Location = new System.Drawing.Point(440, 160);
- this.txt13.Name = "txt13";
- this.txt13.Size = new System.Drawing.Size(72, 21);
- this.txt13.TabIndex = 15;
- this.txt13.Text = "";
- //
- // txt16
- //
- this.txt16.Location = new System.Drawing.Point(48, 248);
- this.txt16.Name = "txt16";
- this.txt16.Size = new System.Drawing.Size(576, 21);
- this.txt16.TabIndex = 19;
- this.txt16.Text = "";
- //
- // txt5
- //
- this.txt5.Location = new System.Drawing.Point(128, 101);
- this.txt5.Name = "txt5";
- this.txt5.Size = new System.Drawing.Size(96, 21);
- this.txt5.TabIndex = 7;
- this.txt5.Text = "";
- //
- // txt10
- //
- this.txt10.Location = new System.Drawing.Point(208, 158);
- this.txt10.Name = "txt10";
- this.txt10.TabIndex = 12;
- this.txt10.Text = "";
- //
- // txt14
- //
- this.txt14.Location = new System.Drawing.Point(16, 216);
- this.txt14.Name = "txt14";
- this.txt14.Size = new System.Drawing.Size(208, 21);
- this.txt14.TabIndex = 16;
- this.txt14.Text = "";
- //
- // txt1
- //
- this.txt1.Location = new System.Drawing.Point(16, 43);
- this.txt1.Name = "txt1";
- this.txt1.Size = new System.Drawing.Size(80, 21);
- this.txt1.TabIndex = 0;
- this.txt1.Text = "";
- //
- // txt2
- //
- this.txt2.Location = new System.Drawing.Point(112, 43);
- this.txt2.Name = "txt2";
- this.txt2.Size = new System.Drawing.Size(64, 21);
- this.txt2.TabIndex = 1;
- this.txt2.Text = "";
- //
- // txt9
- //
- this.txt9.Location = new System.Drawing.Point(128, 158);
- this.txt9.Name = "txt9";
- this.txt9.Size = new System.Drawing.Size(64, 21);
- this.txt9.TabIndex = 11;
- this.txt9.Text = "";
- //
- // txt8
- //
- this.txt8.Location = new System.Drawing.Point(16, 158);
- this.txt8.Name = "txt8";
- this.txt8.TabIndex = 10;
- this.txt8.Text = "";
- //
- // txt4
- //
- this.txt4.Location = new System.Drawing.Point(16, 101);
- this.txt4.Name = "txt4";
- this.txt4.TabIndex = 6;
- this.txt4.Text = "";
- //
- // txt3
- //
- this.txt3.Location = new System.Drawing.Point(192, 43);
- this.txt3.Name = "txt3";
- this.txt3.Size = new System.Drawing.Size(64, 21);
- this.txt3.TabIndex = 2;
- this.txt3.Text = "";
- //
- // txt7
- //
- this.txt7.Location = new System.Drawing.Point(384, 101);
- this.txt7.Name = "txt7";
- this.txt7.Size = new System.Drawing.Size(240, 21);
- this.txt7.TabIndex = 9;
- this.txt7.Text = "";
- //
- // cmb3
- //
- this.cmb3.Items.AddRange(new object[] {
- "安徽",
- "北京",
- "河南",
- "河北",
- "其他"});
- this.cmb3.Location = new System.Drawing.Point(472, 40);
- this.cmb3.Name = "cmb3";
- this.cmb3.Size = new System.Drawing.Size(152, 20);
- this.cmb3.TabIndex = 5;
- //
- // cmb2
- //
- this.cmb2.Items.AddRange(new object[] {
- "汉族",
- "壮族",
- "满族",
- "苗族",
- "其他"});
- this.cmb2.Location = new System.Drawing.Point(352, 40);
- this.cmb2.Name = "cmb2";
- this.cmb2.Size = new System.Drawing.Size(100, 20);
- this.cmb2.TabIndex = 4;
- //
- // cmb4
- //
- this.cmb4.Location = new System.Drawing.Point(352, 216);
- this.cmb4.Name = "cmb4";
- this.cmb4.Size = new System.Drawing.Size(96, 20);
- this.cmb4.TabIndex = 18;
- this.cmb4.SelectedIndexChanged += new System.EventHandler(this.cmb4_SelectedIndexChanged);
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(352, 194);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(64, 16);
- this.label2.TabIndex = 19;
- this.label2.Text = "单位编号";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(16, 76);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(64, 16);
- this.label3.TabIndex = 19;
- this.label3.Text = "出生日期";
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(128, 76);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(48, 16);
- this.label4.TabIndex = 19;
- this.label4.Text = "年龄";
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(240, 76);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(64, 16);
- this.label5.TabIndex = 19;
- this.label5.Text = "文化程度";
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(112, 19);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(48, 16);
- this.label6.TabIndex = 19;
- this.label6.Text = "姓名";
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(384, 72);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(64, 16);
- this.label7.TabIndex = 19;
- this.label7.Text = "毕业学校";
- //
- // label8
- //
- this.label8.Location = new System.Drawing.Point(16, 19);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(64, 16);
- this.label8.TabIndex = 19;
- this.label8.Text = "职员编号";
- //
- // label9
- //
- this.label9.Location = new System.Drawing.Point(16, 134);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(64, 16);
- this.label9.TabIndex = 19;
- this.label9.Text = "健康状况";
- //
- // label10
- //
- this.label10.Location = new System.Drawing.Point(208, 134);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(64, 16);
- this.label10.TabIndex = 19;
- this.label10.Text = "身份证号码";
- //
- // label11
- //
- this.label11.Location = new System.Drawing.Point(320, 134);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(64, 16);
- this.label11.TabIndex = 19;
- this.label11.Text = "家庭电话";
- //
- // label12
- //
- this.label12.Location = new System.Drawing.Point(128, 134);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(64, 16);
- this.label12.TabIndex = 19;
- this.label12.Text = "婚姻状况";
- //
- // label13
- //
- this.label13.Location = new System.Drawing.Point(432, 134);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(72, 16);
- this.label13.TabIndex = 19;
- this.label13.Text = "办公室电话";
- //
- // label14
- //
- this.label14.Location = new System.Drawing.Point(352, 16);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(48, 16);
- this.label14.TabIndex = 19;
- this.label14.Text = "民族";
- //
- // label15
- //
- this.label15.Location = new System.Drawing.Point(472, 16);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(48, 16);
- this.label15.TabIndex = 19;
- this.label15.Text = "籍贯";
- //
- // label16
- //
- this.label16.Location = new System.Drawing.Point(272, 19);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(48, 16);
- this.label16.TabIndex = 19;
- this.label16.Text = "性别";
- //
- // label17
- //
- this.label17.Location = new System.Drawing.Point(16, 192);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(80, 16);
- this.label17.TabIndex = 19;
- this.label17.Text = "电子邮件地址";
- //
- // label18
- //
- this.label18.Location = new System.Drawing.Point(192, 19);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(56, 16);
- this.label18.TabIndex = 19;
- this.label18.Text = "姓名简码";
- //
- // label19
- //
- this.label19.Location = new System.Drawing.Point(240, 194);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(64, 16);
- this.label19.TabIndex = 19;
- this.label19.Text = "职工账号";
- //
- // label21
- //
- this.label21.Location = new System.Drawing.Point(16, 250);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(32, 16);
- this.label21.TabIndex = 19;
- this.label21.Text = "备注";
- //
- // label20
- //
- this.label20.Location = new System.Drawing.Point(464, 194);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(64, 16);
- this.label20.TabIndex = 19;
- this.label20.Text = "单位名称";
- //
- // toolBar1
- //
- this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
- this.toolBarFirst,
- this.toolBarPre,
- this.toolBarNext,
- this.toolBarLast,
- this.tbarBtnNew,
- this.tbarBtnDelete,
- this.toolBarSubmit,
- this.toolBarCancel,
- this.toolBarQuit});
- this.toolBar1.DropDownArrows = true;
- this.toolBar1.ImageList = this.imageList1;
- this.toolBar1.Location = new System.Drawing.Point(0, 0);
- this.toolBar1.Name = "toolBar1";
- this.toolBar1.ShowToolTips = true;
- this.toolBar1.Size = new System.Drawing.Size(642, 41);
- this.toolBar1.TabIndex = 24;
- this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
- //
- // toolBarFirst
- //
- this.toolBarFirst.ImageIndex = 0;
- this.toolBarFirst.Text = "首记录";
- this.toolBarFirst.ToolTipText = "首记录";
- //
- // toolBarPre
- //
- this.toolBarPre.ImageIndex = 1;
- this.toolBarPre.Text = "上一记录";
- this.toolBarPre.ToolTipText = "上一记录";
- //
- // toolBarNext
- //
- this.toolBarNext.ImageIndex = 2;
- this.toolBarNext.Text = "下一记录";
- this.toolBarNext.ToolTipText = "下一记录";
- //
- // toolBarLast
- //
- this.toolBarLast.ImageIndex = 3;
- this.toolBarLast.Text = "尾记录";
- this.toolBarLast.ToolTipText = "尾记录";
- //
- // tbarBtnNew
- //
- this.tbarBtnNew.ImageIndex = 4;
- this.tbarBtnNew.Text = "新增记录";
- this.tbarBtnNew.ToolTipText = "新增记录";
- //
- // tbarBtnDelete
- //
- this.tbarBtnDelete.ImageIndex = 5;
- this.tbarBtnDelete.Text = "删除记录";
- this.tbarBtnDelete.ToolTipText = "删除记录";
- //
- // toolBarSubmit
- //
- this.toolBarSubmit.ImageIndex = 6;
- this.toolBarSubmit.Text = "提交修改";
- this.toolBarSubmit.ToolTipText = "提交修改";
- //
- // toolBarCancel
- //
- this.toolBarCancel.ImageIndex = 7;
- this.toolBarCancel.Text = "取消修改";
- this.toolBarCancel.ToolTipText = "取消修改";
- //
- // toolBarQuit
- //
- this.toolBarQuit.ImageIndex = 8;
- this.toolBarQuit.Text = "退出";
- this.toolBarQuit.ToolTipText = "退出";
- //
- // imageList1
- //
- this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
- this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // sqlDataAdapter1
- //
- this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
- this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
- this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
- this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
- new System.Data.Common.DataTableMapping("Table", "职员基本信息表", new System.Data.Common.DataColumnMapping[] {
- new System.Data.Common.DataColumnMapping("内部编号", "内部编号"),
- new System.Data.Common.DataColumnMapping("职员编号", "职员编号"),
- new System.Data.Common.DataColumnMapping("姓名", "姓名"),
- new System.Data.Common.DataColumnMapping("姓名简码", "姓名简码"),
- new System.Data.Common.DataColumnMapping("性别", "性别"),
- new System.Data.Common.DataColumnMapping("出生日期", "出生日期"),
- new System.Data.Common.DataColumnMapping("年龄", "年龄"),
- new System.Data.Common.DataColumnMapping("籍贯", "籍贯"),
- new System.Data.Common.DataColumnMapping("民族", "民族"),
- new System.Data.Common.DataColumnMapping("文化程度", "文化程度"),
- new System.Data.Common.DataColumnMapping("毕业学校", "毕业学校"),
- new System.Data.Common.DataColumnMapping("健康状况", "健康状况"),
- new System.Data.Common.DataColumnMapping("婚姻状况", "婚姻状况"),
- new System.Data.Common.DataColumnMapping("身份证号码", "身份证号码"),
- new System.Data.Common.DataColumnMapping("家庭电话", "家庭电话"),
- new System.Data.Common.DataColumnMapping("办公电话", "办公电话"),
- new System.Data.Common.DataColumnMapping("手机", "手机"),
- new System.Data.Common.DataColumnMapping("电子邮件地址", "电子邮件地址"),
- new System.Data.Common.DataColumnMapping("职工账号", "职工账号"),
- new System.Data.Common.DataColumnMapping("单位编号", "单位编号"),
- new System.Data.Common.DataColumnMapping("备注", "备注")})});
- this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
- //
- // sqlDeleteCommand1
- //
- this.sqlDeleteCommand1.CommandText = @"DELETE FROM 职员基本信息表 WHERE (职员编号 = @Original_职员编号) AND (健康状况 = @Original_健康状况 OR @Original_健康状况 IS NULL AND 健康状况 IS NULL) AND (内部编号 = @Original_内部编号) AND (出生日期 = @Original_出生日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (办公电话 = @Original_办公电话 OR @Original_办公电话 IS NULL AND 办公电话 IS NULL) AND (单位编号 = @Original_单位编号 OR @Original_单位编号 IS NULL AND 单位编号 IS NULL) AND (备注 = @Original_备注 OR @Original_备注 IS NULL AND 备注 IS NULL) AND (姓名 = @Original_姓名) AND (姓名简码 = @Original_姓名简码 OR @Original_姓名简码 IS NULL AND 姓名简码 IS NULL) AND (婚姻状况 = @Original_婚姻状况 OR @Original_婚姻状况 IS NULL AND 婚姻状况 IS NULL) AND (家庭电话 = @Original_家庭电话 OR @Original_家庭电话 IS NULL AND 家庭电话 IS NULL) AND (年龄 = @Original_年龄 OR @Original_年龄 IS NULL AND 年龄 IS NULL) AND (性别 = @Original_性别 OR @Original_性别 IS NULL AND 性别 IS NULL) AND (手机 = @Original_手机 OR @Original_手机 IS NULL AND 手机 IS NULL) AND (文化程度 = @Original_文化程度 OR @Original_文化程度 IS NULL AND 文化程度 IS NULL) AND (毕业学校 = @Original_毕业学校 OR @Original_毕业学校 IS NULL AND 毕业学校 IS NULL) AND (民族 = @Original_民族 OR @Original_民族 IS NULL AND 民族 IS NULL) AND (电子邮件地址 = @Original_电子邮件地址 OR @Original_电子邮件地址 IS NULL AND 电子邮件地址 IS NULL) AND (籍贯 = @Original_籍贯 OR @Original_籍贯 IS NULL AND 籍贯 IS NULL) AND (职工账号 = @Original_职工账号 OR @Original_职工账号 IS NULL AND 职工账号 IS NULL) AND (身份证号码 = @Original_身份证号码 OR @Original_身份证号码 IS NULL AND 身份证号码 IS NULL)";
- this.sqlDeleteCommand1.Connection = this.sqlConnection2;
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职员编号", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职员编号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_健康状况", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "健康状况", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_内部编号", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "内部编号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_办公电话", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "办公电话", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_单位编号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单位编号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_备注", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "备注", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名简码", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名简码", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_婚姻状况", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "婚姻状况", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_家庭电话", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "家庭电话", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_年龄", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "年龄", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性别", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性别", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_手机", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "手机", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_文化程度", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "文化程度", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_毕业学校", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "毕业学校", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_民族", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "民族", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_电子邮件地址", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "电子邮件地址", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_籍贯", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "籍贯", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职工账号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职工账号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_身份证号码", System.Data.SqlDbType.VarChar, 18, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "身份证号码", System.Data.DataRowVersion.Original, null));
- //
- // sqlConnection2
- //
- this.sqlConnection2.ConnectionString = "workstation id=localhost;Integrated Security=SSPI;Database=hrmbook;";
- //
- // sqlInsertCommand1
- //
- this.sqlInsertCommand1.CommandText = @"INSERT INTO 职员基本信息表(职员编号, 姓名, 姓名简码, 性别, 出生日期, 年龄, 籍贯, 民族, 文化程度, 毕业学校, 健康状况, 婚姻状况, 身份证号码, 家庭电话, 办公电话, 手机, 电子邮件地址, 职工账号, 单位编号, 备注) VALUES (@职员编号, @姓名, @姓名简码, @性别, @出生日期, @年龄, @籍贯, @民族, @文化程度, @毕业学校, @健康状况, @婚姻状况, @身份证号码, @家庭电话, @办公电话, @手机, @电子邮件地址, @职工账号, @单位编号, @备注); SELECT 内部编号, 职员编号, 姓名, 姓名简码, 性别, 出生日期, 年龄, 籍贯, 民族, 文化程度, 毕业学校, 健康状况, 婚姻状况, 身份证号码, 家庭电话, 办公电话, 手机, 电子邮件地址, 职工账号, 单位编号, 备注 FROM 职员基本信息表 WHERE (职员编号 = @职员编号)";
- this.sqlInsertCommand1.Connection = this.sqlConnection2;
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职员编号", System.Data.SqlDbType.VarChar, 30, "职员编号"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 20, "姓名"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名简码", System.Data.SqlDbType.VarChar, 10, "姓名简码"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.VarChar, 2, "性别"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.Int, 4, "出生日期"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@年龄", System.Data.SqlDbType.Int, 4, "年龄"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@籍贯", System.Data.SqlDbType.VarChar, 50, "籍贯"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@民族", System.Data.SqlDbType.VarChar, 20, "民族"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@文化程度", System.Data.SqlDbType.VarChar, 50, "文化程度"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@毕业学校", System.Data.SqlDbType.VarChar, 100, "毕业学校"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@健康状况", System.Data.SqlDbType.VarChar, 50, "健康状况"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@婚姻状况", System.Data.SqlDbType.VarChar, 10, "婚姻状况"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@身份证号码", System.Data.SqlDbType.VarChar, 18, "身份证号码"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@家庭电话", System.Data.SqlDbType.VarChar, 50, "家庭电话"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@办公电话", System.Data.SqlDbType.VarChar, 50, "办公电话"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@手机", System.Data.SqlDbType.VarChar, 50, "手机"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@电子邮件地址", System.Data.SqlDbType.VarChar, 50, "电子邮件地址"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职工账号", System.Data.SqlDbType.VarChar, 20, "职工账号"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@单位编号", System.Data.SqlDbType.VarChar, 20, "单位编号"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 100, "备注"));
- //
- // sqlSelectCommand1
- //
- this.sqlSelectCommand1.CommandText = "SELECT 内部编号, 职员编号, 姓名, 姓名简码, 性别, 出生日期, 年龄, 籍贯, 民族, 文化程度, 毕业学校, 健康状况, 婚姻状况, 身份证号码," +
- " 家庭电话, 办公电话, 手机, 电子邮件地址, 职工账号, 单位编号, 备注 FROM 职员基本信息表";
- this.sqlSelectCommand1.Connection = this.sqlConnection2;
- //
- // sqlUpdateCommand1
- //
- this.sqlUpdateCommand1.CommandText = "UPDATE 职员基本信息表 SET 职员编号 = @职员编号, 姓名 = @姓名, 姓名简码 = @姓名简码, 性别 = @性别, 出生日期 = @出生日期, " +
- "年龄 = @年龄, 籍贯 = @籍贯, 民族 = @民族, 文化程度 = @文化程度, 毕业学校 = @毕业学校, 健康状况 = @健康状况, 婚姻状况 = @" +
- "婚姻状况, 身份证号码 = @身份证号码, 家庭电话 = @家庭电话, 办公电话 = @办公电话, 手机 = @手机, 电子邮件地址 = @电子邮件地址, 职工" +
- "账号 = @职工账号, 单位编号 = @单位编号, 备注 = @备注 WHERE (职员编号 = @Original_职员编号) AND (健康状况 = @Or" +
- "iginal_健康状况 OR @Original_健康状况 IS NULL AND 健康状况 IS NULL) AND (出生日期 = @Original_出生" +
- "日期 OR @Original_出生日期 IS NULL AND 出生日期 IS NULL) AND (办公电话 = @Original_办公电话 OR @Or" +
- "iginal_办公电话 IS NULL AND 办公电话 IS NULL) AND (单位编号 = @Original_单位编号 OR @Original_单位" +
- "编号 IS NULL AND 单位编号 IS NULL) AND (备注 = @Original_备注 OR @Original_备注 IS NULL AND " +
- "备注 IS NULL) AND (姓名 = @Original_姓名) AND (姓名简码 = @Original_姓名简码 OR @Original_姓名简码" +
- " IS NULL AND 姓名简码 IS NULL) AND (婚姻状况 = @Original_婚姻状况 OR @Original_婚姻状况 IS NULL " +
- "AND 婚姻状况 IS NULL) AND (家庭电话 = @Original_家庭电话 OR @Original_家庭电话 IS NULL AND 家庭电话 " +
- "IS NULL) AND (年龄 = @Original_年龄 OR @Original_年龄 IS NULL AND 年龄 IS NULL) AND (性别 " +
- "= @Original_性别 OR @Original_性别 IS NULL AND 性别 IS NULL) AND (手机 = @Original_手机 OR" +
- " @Original_手机 IS NULL AND 手机 IS NULL) AND (文化程度 = @Original_文化程度 OR @Original_文化" +
- "程度 IS NULL AND 文化程度 IS NULL) AND (毕业学校 = @Original_毕业学校 OR @Original_毕业学校 IS NUL" +
- "L AND 毕业学校 IS NULL) AND (民族 = @Original_民族 OR @Original_民族 IS NULL AND 民族 IS NUL" +
- "L) AND (电子邮件地址 = @Original_电子邮件地址 OR @Original_电子邮件地址 IS NULL AND 电子邮件地址 IS NULL" +
- ") AND (籍贯 = @Original_籍贯 OR @Original_籍贯 IS NULL AND 籍贯 IS NULL) AND (职工账号 = @Or" +
- "iginal_职工账号 OR @Original_职工账号 IS NULL AND 职工账号 IS NULL) AND (身份证号码 = @Original_身" +
- "份证号码 OR @Original_身份证号码 IS NULL AND 身份证号码 IS NULL); SELECT 内部编号, 职员编号, 姓名, 姓名简码," +
- " 性别, 出生日期, 年龄, 籍贯, 民族, 文化程度, 毕业学校, 健康状况, 婚姻状况, 身份证号码, 家庭电话, 办公电话, 手机, 电子邮件地址, 职工" +
- "账号, 单位编号, 备注 FROM 职员基本信息表 WHERE (职员编号 = @职员编号)";
- this.sqlUpdateCommand1.Connection = this.sqlConnection2;
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职员编号", System.Data.SqlDbType.VarChar, 30, "职员编号"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 20, "姓名"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名简码", System.Data.SqlDbType.VarChar, 10, "姓名简码"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@性别", System.Data.SqlDbType.VarChar, 2, "性别"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@出生日期", System.Data.SqlDbType.Int, 4, "出生日期"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@年龄", System.Data.SqlDbType.Int, 4, "年龄"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@籍贯", System.Data.SqlDbType.VarChar, 50, "籍贯"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@民族", System.Data.SqlDbType.VarChar, 20, "民族"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@文化程度", System.Data.SqlDbType.VarChar, 50, "文化程度"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@毕业学校", System.Data.SqlDbType.VarChar, 100, "毕业学校"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@健康状况", System.Data.SqlDbType.VarChar, 50, "健康状况"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@婚姻状况", System.Data.SqlDbType.VarChar, 10, "婚姻状况"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@身份证号码", System.Data.SqlDbType.VarChar, 18, "身份证号码"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@家庭电话", System.Data.SqlDbType.VarChar, 50, "家庭电话"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@办公电话", System.Data.SqlDbType.VarChar, 50, "办公电话"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@手机", System.Data.SqlDbType.VarChar, 50, "手机"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@电子邮件地址", System.Data.SqlDbType.VarChar, 50, "电子邮件地址"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职工账号", System.Data.SqlDbType.VarChar, 20, "职工账号"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@单位编号", System.Data.SqlDbType.VarChar, 20, "单位编号"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 100, "备注"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职员编号", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职员编号", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_健康状况", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "健康状况", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_出生日期", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "出生日期", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_办公电话", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "办公电话", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_单位编号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "单位编号", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_备注", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "备注", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_姓名简码", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "姓名简码", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_婚姻状况", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "婚姻状况", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_家庭电话", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "家庭电话", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_年龄", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "年龄", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_性别", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "性别", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_手机", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "手机", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_文化程度", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "文化程度", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_毕业学校", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "毕业学校", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_民族", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "民族", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_电子邮件地址", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "电子邮件地址", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_籍贯", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "籍贯", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职工账号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职工账号", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_身份证号码", System.Data.SqlDbType.VarChar, 18, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "身份证号码", System.Data.DataRowVersion.Original, null));
- //
- // AmendStafferInfo
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(642, 469);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.dataGrid1);
- this.Controls.Add(this.toolBar1);
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "AmendStafferInfo";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "【职员信息维护】";
- this.Load += new System.EventHandler(this.AmendStafferInfo_Load);
- ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
- this.groupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion
- //--------------------初始化窗体,读入数据------------------
- private void AmendStafferInfo_Load(object sender, System.EventArgs e)
- {
- this.sqlDataAdapter1.Fill(tempTable);
- this.dataGrid1.DataSource = tempTable.DefaultView;
- InputComboBox();//填充【单位编号】下拉列表框的下拉列表
- DataGridStateControl();
- DataBindingsFunction();
- cmAmend = (CurrencyManager) BindingContext[tempTable];
- }
- //--------------将数据显示在表格中,并设置表格参数------------------
- private void DataGridStateControl()
- {
- DataGridTableStyle ts = new DataGridTableStyle();
- DataGridNoActiveCellColumn aColumnTextColumn;
- ts.AlternatingBackColor = Color.LightGray;
- ts.MappingName = tempTable.TableName;
- ts.AllowSorting = false;//不允许进行排序
- int numCols = tempTable.Columns.Count;
- for (int i = 1;i< numCols;i++) //从第二列开始,不显示第一列的“职员编号”
- {
- aColumnTextColumn = new DataGridNoActiveCellColumn();
- aColumnTextColumn.MappingName = tempTable.Columns[i].ColumnName;
- aColumnTextColumn.HeaderText = tempTable.Columns[i].ColumnName;
- aColumnTextColumn.NullText = "";
- aColumnTextColumn.Format = "D";
- ts.GridColumnStyles.Add(aColumnTextColumn);
- }
- this.dataGrid1.TableStyles.Add(ts);
- this.dataGrid1.Select(0);//选定第一列
- }
- //--------------为面板中的文本框绑定数据集中的相应字段------------------
- private void DataBindingsFunction()
- {
- this.txt1.DataBindings.Add("Text",tempTable,"职员编号");
- this.txt2.DataBindings.Add("Text",tempTable,"姓名");
- this.txt3.DataBindings.Add("Text",tempTable,"姓名简码");
- this.txt4.DataBindings.Add("Text",tempTable,"出生日期");
- this.txt5.DataBindings.Add("Text",tempTable,"年龄");
- this.txt6.DataBindings.Add("Text",tempTable,"文化程度");
- this.txt7.DataBindings.Add("Text",tempTable,"毕业学校");
- this.txt8.DataBindings.Add("Text",tempTable,"健康状况");
- this.txt9.DataBindings.Add("Text",tempTable,"婚姻状况");
- this.txt10.DataBindings.Add("Text",tempTable,"身份证号码");
- this.txt11.DataBindings.Add("Text",tempTable,"家庭电话");
- this.txt12.DataBindings.Add("Text",tempTable,"办公电话");
- this.txt13.DataBindings.Add("Text",tempTable,"手机");
- this.txt14.DataBindings.Add("Text",tempTable,"电子邮件地址");
- this.txt15.DataBindings.Add("Text",tempTable,"职工账号");
- this.txt16.DataBindings.Add("Text",tempTable,"备注");
- this.cmb1.DataBindings.Add("Text",tempTable,"性别");
- this.cmb2.DataBindings.Add("Text",tempTable,"民族");
- this.cmb3.DataBindings.Add("Text",tempTable,"籍贯");
- this.cmb4.DataBindings.Add("Text",tempTable,"单位编号");
- }
- //-----------为【单位编号】下拉列表框设置下拉数据辞典---------------
- private void InputComboBox()
- {
- this.strSQL = "select 单位编号 from 组织机构编码表 order by 单位编号";
- this.da = new SqlDataAdapter(this.strSQL,this.tempConnection);
- this.da.Fill(tblDataSource);
- for (int i=0;i<tblDataSource.Rows.Count;i++)
- this.cmb4.Items.Add(tblDataSource.Rows[i][0]);
- }
- //-----------处理数据导航按钮与新增修改等事务---------------
- private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
- {
- if (e.Button.ToolTipText == "首记录")
- {
- this.dataGrid1.UnSelect(cmAmend.Position); //取消选中指定行
- cmAmend.Position = 0;
- this.dataGrid1.Select(cmAmend.Position); //选中指定行
- this.dataGrid1.CurrentRowIndex = cmAmend.Position; //移动表头指示图标
- return;
- }
- if (e.Button.ToolTipText == "上一记录")
- {
- if (cmAmend.Position > 0)
- {
- this.dataGrid1.UnSelect(cmAmend.Position);
- cmAmend.Position--;
- this.dataGrid1.Select(cmAmend.Position);
- this.dataGrid1.CurrentRowIndex = cmAmend.Position;
- }
- return;
- }
- if (e.Button.ToolTipText == "下一记录")
- {
- if (cmAmend.Position < cmAmend.Count-1)
- {
- this.dataGrid1.UnSelect(cmAmend.Position);
- cmAmend.Position++;
- this.dataGrid1.Select(cmAmend.Position);
- this.dataGrid1.CurrentRowIndex = cmAmend.Position;
- }
- return;
- }
- if (e.Button.ToolTipText == "尾记录")
- {
- this.dataGrid1.UnSelect(cmAmend.Position);
- cmAmend.Position = cmAmend.Count-1;
- this.dataGrid1.Select(cmAmend.Position);
- this.dataGrid1.CurrentRowIndex = cmAmend.Position;
- return;
- }
- if (e.Button.ToolTipText == "新增记录")
- {
- cmAmend.AddNew();
- return;
- }
- if (e.Button.ToolTipText == "删除记录")
- {
- if (MessageBox.Show(" 确实要删除这条记录吗?","询问",MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- try
- {
- if (cmAmend.Count > 0)
- cmAmend.RemoveAt(cmAmend.Position);
- else
- {
- MessageBox.Show("没有可以删除的数据","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- }
- catch(Exception express)
- {
- MessageBox.Show(express.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- return;
- }
- }
- if (e.Button.ToolTipText == "提交修改")
- {
- if (this.txt1.Text.Trim() == "")//检查不能为空的字段
- {
- MessageBox.Show("职员编号不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- return;
- }
- if (this.txt2.Text.Trim()=="")
- {
- MessageBox.Show("职员姓名不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- return;
- }
- cmAmend.EndCurrentEdit();//结束当前编辑操作并提交修改
- if (tempTable.GetChanges() != null)
- {
- try
- {
- this.sqlDataAdapter1.Update(tempTable);
- }
- catch(Exception express)
- {
- MessageBox.Show(express.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- this.tempTable.RejectChanges();
- }
- }
- return;
- }
- if (e.Button.ToolTipText == "取消修改")
- {
- try
- {
- cmAmend.CancelCurrentEdit(); //取消编辑
- }
- catch(Exception express)
- {
- MessageBox.Show(express.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- return;
- }
- if (e.Button.ToolTipText == "退出")
- {
- this.Close();
- }
- }
- //---------在【机构编码】下拉列表框右边的文本框中显示与之对应的机构名称-------
- private void cmb4_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- DataTable tempTable = new DataTable();
- string strSearchWord = this.cmb4.Text.Trim();
- this.strSQL = "select 单位名称 from 组织机构编码表 where 单位编号 = '" + strSearchWord + "'";
- this.da = new SqlDataAdapter(this.strSQL,this.tempConnection);
- this.da.Fill(tempTable);//查询获得机构的单位名称,并填写到文本框中
- if (tempTable.Rows.Count>0)
- {
- this.txt17.Text = tempTable.Rows[0][0].ToString().Trim();
- this.cmb4.SelectAll();
- }
- }
- //-------------------选择表格中的任何一个单元,等同于选中一行----------------
- private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
- {
- if (this.tempTable.Rows.Count > 0)
- {
- int currentRowNumber = this.dataGrid1.CurrentCell.RowNumber;
- if (currentRowNumber >= 0 && currentRowNumber < cmAmend.Count)
- cmAmend.Position = currentRowNumber;
- }
- }
- }
- }