📄 form_mbwh.cs
字号:
// btn_qx
//
this.btn_qx.Location = new System.Drawing.Point(704, 16);
this.btn_qx.Name = "btn_qx";
this.btn_qx.TabIndex = 8;
this.btn_qx.Text = "取消";
this.btn_qx.Click += new System.EventHandler(this.btn_qx_Click);
//
// btn_qrtj
//
this.btn_qrtj.Location = new System.Drawing.Point(617, 16);
this.btn_qrtj.Name = "btn_qrtj";
this.btn_qrtj.TabIndex = 7;
this.btn_qrtj.Text = "确认提交";
this.btn_qrtj.Click += new System.EventHandler(this.btn_qrtj_Click);
//
// btn_sc
//
this.btn_sc.Location = new System.Drawing.Point(530, 16);
this.btn_sc.Name = "btn_sc";
this.btn_sc.TabIndex = 6;
this.btn_sc.Text = "删除";
this.btn_sc.Click += new System.EventHandler(this.btn_sc_Click);
//
// btn_tj
//
this.btn_tj.Location = new System.Drawing.Point(443, 16);
this.btn_tj.Name = "btn_tj";
this.btn_tj.TabIndex = 5;
this.btn_tj.Text = "添加";
this.btn_tj.Click += new System.EventHandler(this.btn_tj_Click);
//
// btn_bj
//
this.btn_bj.Location = new System.Drawing.Point(356, 16);
this.btn_bj.Name = "btn_bj";
this.btn_bj.TabIndex = 4;
this.btn_bj.Text = "编辑";
this.btn_bj.Click += new System.EventHandler(this.btn_bj_Click);
//
// btn_mjl
//
this.btn_mjl.Location = new System.Drawing.Point(269, 16);
this.btn_mjl.Name = "btn_mjl";
this.btn_mjl.TabIndex = 3;
this.btn_mjl.Text = "末记录";
this.btn_mjl.Click += new System.EventHandler(this.btn_mjl_Click);
//
// btn_hyjl
//
this.btn_hyjl.Location = new System.Drawing.Point(182, 16);
this.btn_hyjl.Name = "btn_hyjl";
this.btn_hyjl.TabIndex = 2;
this.btn_hyjl.Text = "后一记录";
this.btn_hyjl.Click += new System.EventHandler(this.btn_hyjl_Click);
//
// btn_qyjl
//
this.btn_qyjl.Location = new System.Drawing.Point(95, 16);
this.btn_qyjl.Name = "btn_qyjl";
this.btn_qyjl.TabIndex = 1;
this.btn_qyjl.Text = "前一记录";
this.btn_qyjl.Click += new System.EventHandler(this.btn_qyjl_Click);
//
// btn_sjl
//
this.btn_sjl.Location = new System.Drawing.Point(8, 16);
this.btn_sjl.Name = "btn_sjl";
this.btn_sjl.TabIndex = 0;
this.btn_sjl.Text = "首记录";
this.btn_sjl.Click += new System.EventHandler(this.btn_sjl_Click);
//
// lbl_xqck
//
this.lbl_xqck.Location = new System.Drawing.Point(8, 272);
this.lbl_xqck.Name = "lbl_xqck";
this.lbl_xqck.TabIndex = 5;
this.lbl_xqck.Text = "详情窗口";
//
// Form_mbwh
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(792, 573);
this.Controls.Add(this.lbl_xqck);
this.Controls.Add(this.pnl_mbwh2);
this.Controls.Add(this.pnl_mbwh1);
this.Controls.Add(this.gpb_mb);
this.Controls.Add(this.dgd_mbwh);
this.Name = "Form_mbwh";
this.Text = "码表维护";
this.Load += new System.EventHandler(this.Form_mbwh_Load);
((System.ComponentModel.ISupportInitialize)(this.dgd_mbwh)).EndInit();
this.gpb_mb.ResumeLayout(false);
this.pnl_mbwh1.ResumeLayout(false);
this.pnl_mbwh2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void TextEnTrue()
{
this.txt_dm.Enabled=true;
this.txt_mc.Enabled=true;
}
private void TextEnFalse()
{
this.txt_dm.Enabled=false;
this.txt_mc.Enabled=false;
}
private void EnFalse()
{
this.btn_sjl.Enabled=false;
this.btn_mjl.Enabled=false;
this.btn_qyjl.Enabled=false;
this.btn_hyjl.Enabled=false;
this.btn_bj.Enabled=false;
this.btn_tj.Enabled=false;
this.btn_sc.Enabled=false;
this.btn_qrtj.Enabled=false;
this.btn_qx.Enabled=false;
}
private void EnTrue()
{
this.btn_sjl.Enabled=true;
this.btn_mjl.Enabled=true;
this.btn_qyjl.Enabled=true;
this.btn_hyjl.Enabled=true;
this.btn_bj.Enabled=true;
this.btn_tj.Enabled=true;
this.btn_sc.Enabled=true;
//this.btn_qrtj.Enabled=true;
//this.btn_qx.Enabled=true;
}
private void Form_mbwh_Load(object sender, System.EventArgs e)
{
this.txt_dm.Text="";
this.txt_mc.Text="";
dbAccess dba=new dbAccess();
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ControlBox = false;
this.EnFalse();
sqlcon=new System.Data.SqlClient.SqlConnection(dba.connStr);
sqlcon.Open();
dst=new System.Data.DataSet();
sqlada1=new System.Data.SqlClient.SqlDataAdapter("select * from nation",this.sqlcon);
sqlada1.Fill(dst,"nation");
sqlada2=new System.Data.SqlClient.SqlDataAdapter("select * from sex",this.sqlcon);
sqlada2.Fill(dst,"sex");
sqlada3=new System.Data.SqlClient.SqlDataAdapter("select * from PoliticalFeature",this.sqlcon);
sqlada3.Fill(dst,"PoliticalFeature");
sqlada4=new System.Data.SqlClient.SqlDataAdapter("select * from Maritalstatus",this.sqlcon);
sqlada4.Fill(dst,"Maritalstatus");
sqlada5=new System.Data.SqlClient.SqlDataAdapter("select * from nativePlace",this.sqlcon);
sqlada5.Fill(dst,"nativePlace");
sqlada6=new System.Data.SqlClient.SqlDataAdapter("select * from cultureDegree",this.sqlcon);
sqlada6.Fill(dst,"cultureDegree");
sqlada7=new System.Data.SqlClient.SqlDataAdapter("select * from field",this.sqlcon);
sqlada7.Fill(dst,"field");
sqlada8=new System.Data.SqlClient.SqlDataAdapter("select * from technicalPosition",this.sqlcon);
sqlada8.Fill(dst,"technicalPosition");
sqlada9=new System.Data.SqlClient.SqlDataAdapter("select * from role",this.sqlcon);
sqlada9.Fill(dst,"role");
sqlada10=new System.Data.SqlClient.SqlDataAdapter("select * from class",this.sqlcon);
sqlada10.Fill(dst,"class");
sqlada11=new System.Data.SqlClient.SqlDataAdapter("select * from Department",this.sqlcon);
sqlada11.Fill(dst,"department");
this.TextEnFalse();
// this.lbl_jsqxdm.Visible=false;
// this.txt_jsqxdm.Visible=false;
// this.txt_jsqxdm.Enabled=false;
notable=0;
}
private void btn_mz_Click(object sender, System.EventArgs e)
{
this.txt_bmgw.DataBindings.Clear();
this.txt_bmms.DataBindings.Clear();
this.txt_bmms.Visible=false;
this.lbl_bmms.Visible=false;
this.lbl_bngw.Visible=false;
this.txt_bmgw.Visible=false;
this.txt_bmms.Visible=false;
//if (this.dst.Tables[this.dataset_table])
this.notable=1;
DataGridTableStyle style=new DataGridTableStyle();
style.MappingName="nation";
DataGridTextBoxColumn nat_code = new DataGridTextBoxColumn();
nat_code.HeaderText = "民族代码";
nat_code.MappingName = "nat_code";
nat_code.Width = 100;
DataGridTextBoxColumn nat_name = new DataGridTextBoxColumn();
nat_name.HeaderText = "民族名称";
nat_name.MappingName = "nat_name";
nat_name.Width = 100;
style.GridColumnStyles.AddRange(new DataGridColumnStyle[]{nat_code,nat_name});
this.dgd_mbwh.TableStyles.Clear ();
this.dgd_mbwh.TableStyles.Add(style);
this.txt_mc.DataBindings.Clear();
this.txt_dm.DataBindings.Clear();
this.EnTrue();
this.dgd_mbwh.DataSource=dst;
this.dgd_mbwh.DataMember="nation";
this.txt_dm.DataBindings.Add("text",dst,"nation.nat_code");
this.txt_mc.DataBindings.Add("text",dst,"nation.nat_name");
this.dataset_table="nation";
this.lbl_dm.Text="民族代码";
this.lbl_mc.Text="民族名称";
// this.lbl_jsqxdm.Visible=false;
// this.txt_jsqxdm.Visible=false;
// this.txt_jsqxdm.Enabled=false;
// this.txt_jsqxdm.Visible=false;
this.TextEnFalse();
if (this.change==1)
{
dst.RejectChanges();
this.change=0;
}
}
private void btn_xb_Click(object sender, System.EventArgs e)
{
this.txt_bmgw.DataBindings.Clear();
this.txt_bmms.DataBindings.Clear();
this.lbl_bmms.Visible=false;
this.lbl_bngw.Visible=false;
this.txt_bmgw.Visible=false;
this.txt_bmms.Visible=false;
this.txt_dm.Text="";
this.txt_mc.Text="";
this.notable=1;
DataGridTableStyle style=new DataGridTableStyle();
style.MappingName="sex";
DataGridTextBoxColumn sex_code = new DataGridTextBoxColumn();
sex_code.HeaderText = "性别代码";
sex_code.MappingName = "sex_code";
sex_code.Width = 100;
DataGridTextBoxColumn sex_name = new DataGridTextBoxColumn();
sex_name.HeaderText = "性别名称";
sex_name.MappingName = "sex_name";
sex_name.Width = 100;
style.GridColumnStyles.AddRange(new DataGridColumnStyle[]{sex_code,sex_name});
this.dgd_mbwh.TableStyles.Clear ();
this.dgd_mbwh.TableStyles.Add(style);
this.txt_mc.DataBindings.Clear();
this.txt_dm.DataBindings.Clear();
this.EnTrue();
this.dgd_mbwh.DataSource=dst;
this.dgd_mbwh.DataMember="sex";
this.txt_dm.DataBindings.Add("text",dst,"sex.sex_code");
this.txt_mc.DataBindings.Add("text",dst,"sex.sex_name");
this.dataset_table="sex";
this.lbl_dm.Text="性别代码";
this.lbl_mc.Text="性别名称";
// this.lbl_jsqxdm.Visible=false;
// this.txt_jsqxdm.Visible=false;
// this.txt_jsqxdm.Enabled=false;
// this.txt_jsqxdm.Visible=false;
this.TextEnFalse();
if (this.change==1)
{
dst.RejectChanges();
this.change=0;
}
}
private void btn_zzmm_Click(object sender, System.EventArgs e)
{
this.txt_bmgw.DataBindings.Clear();
this.txt_bmms.DataBindings.Clear();
this.lbl_bmms.Visible=false;
this.lbl_bngw.Visible=false;
this.txt_bmgw.Visible=false;
this.txt_bmms.Visible=false;
this.txt_dm.Text="";
this.txt_mc.Text="";
this.notable=1;
DataGridTableStyle style=new DataGridTableStyle();
style.MappingName="PoliticalFeature";
DataGridTextBoxColumn polf_code = new DataGridTextBoxColumn();
polf_code.HeaderText = "政治面貌代码";
polf_code.MappingName = "polf_code";
polf_code.Width = 100;
DataGridTextBoxColumn polf_name = new DataGridTextBoxColumn();
polf_name.HeaderText = "政治面貌名称";
polf_name.MappingName = "polf_name";
polf_name.Width = 100;
style.GridColumnStyles.AddRange(new DataGridColumnStyle[]{polf_code,polf_name});
this.dgd_mbwh.TableStyles.Clear ();
this.dgd_mbwh.TableStyles.Add(style);
this.txt_mc.DataBindings.Clear();
this.txt_dm.DataBindings.Clear();
this.EnTrue();
this.dgd_mbwh.DataSource=dst;
this.dgd_mbwh.DataMember="PoliticalFeature";
this.txt_dm.DataBindings.Add("text",dst,"PoliticalFeature.polf_code");
this.txt_mc.DataBindings.Add("text",dst,"PoliticalFeature.polf_name");
this.dataset_table="PoliticalFeature";
this.lbl_dm.Text="政治面貌代码";
this.lbl_mc.Text="政治面貌名称";
// this.lbl_jsqxdm.Visible=false;
// this.txt_jsqxdm.Visible=false;
// this.txt_jsqxdm.Enabled=false;
// this.txt_jsqxdm.Visible=false;
this.TextEnFalse();
if (this.change==1)
{
dst.RejectChanges();
this.change=0;
}
}
private void btn_hyzk_Click(object sender, System.EventArgs e)
{
this.txt_bmgw.DataBindings.Clear();
this.txt_bmms.DataBindings.Clear();
this.lbl_bmms.Visible=false;
this.lbl_bngw.Visible=false;
this.txt_bmgw.Visible=false;
this.txt_bmms.Visible=false;
this.txt_dm.Text="";
this.txt_mc.Text="";
this.notable=1;
DataGridTableStyle style=new DataGridTableStyle();
style.MappingName="Maritalstatus";
DataGridTextBoxColumn mars_code = new DataGridTextBoxColumn();
mars_code.HeaderText = "婚姻状况代码";
mars_code.MappingName = "mars_code";
mars_code.Width = 100;
DataGridTextBoxColumn mars_name = new DataGridTextBoxColumn();
mars_name.HeaderText = "婚姻状况名称";
mars_name.MappingName = "mars_name";
mars_name.Width = 100;
style.GridColumnStyles.AddRange(new DataGridColumnStyle[]{mars_code,mars_name});
this.dgd_mbwh.TableStyles.Clear ();
this.dgd_mbwh.TableStyles.Add(style);
this.txt_mc.DataBindings.Clear();
this.txt_dm.DataBindings.Clear();
this.EnTrue();
this.dgd_mbwh.DataSource=dst;
this.dgd_mbwh.DataMember="Maritalstatus";
this.txt_dm.DataBindings.Add("text",dst,"Maritalstatus.mars_code");
this.txt_mc.DataBindings.Add("text",dst,"Maritalstatus.mars_name");
this.dataset_table="Maritalstatus";
this.lbl_dm.Text="婚姻状况代码";
this.lbl_mc.Text="婚姻状况名称";
// this.lbl_jsqxdm.Visible=false;
// this.txt_jsqxdm.Visible=false;
// this.txt_jsqxdm.Enabled=false;
// this.txt_jsqxdm.Visible=false;
this.TextEnFalse();
if (this.change==1)
{
dst.RejectChanges();
this.change=0;
}
}
private void btn_jg_Click(object sender, System.EventArgs e)
{
this.txt_bmgw.DataBindings.Clear();
this.txt_bmms.DataBindings.Clear();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -