📄 addform.cs
字号:
//
// label30
//
this.label30.Location = new System.Drawing.Point(440, 216);
this.label30.Name = "label30";
this.label30.Size = new System.Drawing.Size(48, 16);
this.label30.TabIndex = 51;
this.label30.Text = "工资号";
//
// Med_txt
//
this.Med_txt.Enabled = false;
this.Med_txt.Location = new System.Drawing.Point(320, 208);
this.Med_txt.Name = "Med_txt";
this.Med_txt.TabIndex = 50;
this.Med_txt.Text = "";
this.toolTip1.SetToolTip(this.Med_txt, "系统自动输入");
//
// label31
//
this.label31.Location = new System.Drawing.Point(232, 216);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(72, 16);
this.label31.TabIndex = 49;
this.label31.Text = "医疗保险号";
//
// EenMen_txt
//
this.EenMen_txt.Enabled = false;
this.EenMen_txt.Location = new System.Drawing.Point(96, 208);
this.EenMen_txt.Name = "EenMen_txt";
this.EenMen_txt.TabIndex = 48;
this.EenMen_txt.Text = "";
this.toolTip1.SetToolTip(this.EenMen_txt, "系统自动输入");
//
// label33
//
this.label33.Location = new System.Drawing.Point(8, 216);
this.label33.Name = "label33";
this.label33.Size = new System.Drawing.Size(72, 16);
this.label33.TabIndex = 53;
this.label33.Text = "养老保险号";
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Location = new System.Drawing.Point(760, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(100, 128);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 54;
this.pictureBox1.TabStop = false;
this.toolTip1.SetToolTip(this.pictureBox1, "双击选择相片");
this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Location = new System.Drawing.Point(616, 176);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(240, 56);
this.groupBox1.TabIndex = 55;
this.groupBox1.TabStop = false;
//
// button1
//
this.button1.Location = new System.Drawing.Point(32, 24);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(136, 24);
this.button2.Name = "button2";
this.button2.TabIndex = 0;
this.button2.Text = "取消";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// RaceId_txt
//
this.RaceId_txt.Location = new System.Drawing.Point(56, 280);
this.RaceId_txt.Name = "RaceId_txt";
this.RaceId_txt.Size = new System.Drawing.Size(20, 21);
this.RaceId_txt.TabIndex = 56;
this.RaceId_txt.Text = "1";
//
// SectionId_txt
//
this.SectionId_txt.Location = new System.Drawing.Point(88, 280);
this.SectionId_txt.Name = "SectionId_txt";
this.SectionId_txt.Size = new System.Drawing.Size(20, 21);
this.SectionId_txt.TabIndex = 57;
this.SectionId_txt.Text = "10";
//
// JobId_txt
//
this.JobId_txt.Location = new System.Drawing.Point(152, 280);
this.JobId_txt.Name = "JobId_txt";
this.JobId_txt.Size = new System.Drawing.Size(20, 21);
this.JobId_txt.TabIndex = 58;
this.JobId_txt.Text = "11";
//
// TitleId_txt
//
this.TitleId_txt.Location = new System.Drawing.Point(120, 280);
this.TitleId_txt.Name = "TitleId_txt";
this.TitleId_txt.Size = new System.Drawing.Size(20, 21);
this.TitleId_txt.TabIndex = 59;
this.TitleId_txt.Text = "12";
//
// button3
//
this.button3.Location = new System.Drawing.Point(776, 152);
this.button3.Name = "button3";
this.button3.TabIndex = 60;
this.button3.Text = "上传图片";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// toolTip1
//
this.toolTip1.ShowAlways = true;
//
// AddForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(880, 245);
this.Controls.Add(this.button3);
this.Controls.Add(this.TitleId_txt);
this.Controls.Add(this.JobId_txt);
this.Controls.Add(this.SectionId_txt);
this.Controls.Add(this.RaceId_txt);
this.Controls.Add(this.School_txt);
this.Controls.Add(this.Name_txt);
this.Controls.Add(this.No_txt);
this.Controls.Add(this.Number_txt);
this.Controls.Add(this.Phone_txt);
this.Controls.Add(this.Adress_txt);
this.Controls.Add(this.Wa_txt);
this.Controls.Add(this.Med_txt);
this.Controls.Add(this.EenMen_txt);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label33);
this.Controls.Add(this.label29);
this.Controls.Add(this.App_cb);
this.Controls.Add(this.label25);
this.Controls.Add(this.Source_cb);
this.Controls.Add(this.label26);
this.Controls.Add(this.label23);
this.Controls.Add(this.LeaveSchool_dtp);
this.Controls.Add(this.label19);
this.Controls.Add(this.label20);
this.Controls.Add(this.Degree_cb);
this.Controls.Add(this.label16);
this.Controls.Add(this.Pro_cb);
this.Controls.Add(this.label18);
this.Controls.Add(this.label15);
this.Controls.Add(this.label14);
this.Controls.Add(this.label13);
this.Controls.Add(this.Party_cb);
this.Controls.Add(this.label6);
this.Controls.Add(this.Marrige_cb);
this.Controls.Add(this.label5);
this.Controls.Add(this.Race_cb);
this.Controls.Add(this.label4);
this.Controls.Add(this.Sex_cb);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.label11);
this.Controls.Add(this.Place_cb);
this.Controls.Add(this.label10);
this.Controls.Add(this.label8);
this.Controls.Add(this.Birth_dtp);
this.Controls.Add(this.Edu_cb);
this.Controls.Add(this.EmpType_cb);
this.Controls.Add(this.label22);
this.Controls.Add(this.EmpTime_dtp);
this.Controls.Add(this.Title_cb);
this.Controls.Add(this.label27);
this.Controls.Add(this.Job_cb);
this.Controls.Add(this.label28);
this.Controls.Add(this.Section_cb);
this.Controls.Add(this.label30);
this.Controls.Add(this.label31);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AddForm";
this.Closing += new System.ComponentModel.CancelEventHandler(this.AddForm_Closing);
this.Load += new System.EventHandler(this.AddForm_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
#region 窗体出现加载有关数据
private void AddForm_Load(object sender, System.EventArgs e)
{
this.TopMost =true;
if(empInfoForm.empID == "insert")
{
DBRace_cb();
DBSection_cb();
DBJob_cb();
DBTitle_cb();
}
if(empInfoForm.empID == "update")
{
DB();
DBRace_cb();
DBSection_cb();
DBJob_cb();
DBTitle_cb();
Base b = new Base();
b.ReadImage(int.Parse(empInfoForm.eif.ID),this.pictureBox1);
}
}
#endregion
#region 把选择要修改的员工的信息显示出来
private void DB()
{
string str = "select EmployInfo.rId,EmployInfo.eId as 员工编号,EmployInfo.eName as 员工姓名,EmployInfo.eSex as 性别,RaceInfo.rName as 民族,EmployInfo.eMarriage as 婚否,";
str += "EmployInfo.eParty as 党派,EmployInfo.eBirth as 出生日期,EmployInfo.eNumber as 身份证号,EmployInfo.ePlace as 籍贯,EmployInfo.ePhone as 联系电话,EmployInfo.eAddress as 联系地址,";
str += "EmployInfo.eEdu as 学历,EmployInfo.ePro as 专业,EmployInfo.eDegree as 学位,EmployInfo.eSchool as 毕业学校,EmployInfo.eDate as 毕业时间,";
str += "EmployInfo.eEmpTime as 聘用时间,EmployInfo.eEmpType as 聘用方式,EmployInfo.eEmpDataSource as 聘用来源,EmployInfo.eApp as 员工状态,";
str += "SectionInfo.sId,SectionInfo.sName as 所在部门,JobInfo.jId,JobInfo.JName as 所任职务,Title.tId,Title.tName as 所获职称,EndowmentInfo.endId,EndowmentInfo.enId as 养老保险号,";
str += "MedicalInfo.meId,MedicalInfo.mId as 医疗保险号,WagesInfo.waId,WagesInfo.Id as 工资号 ";
str += "from EmployInfo,RaceInfo,SectionInfo,JobInfo,Title,EndowmentInfo,MedicalInfo,WagesInfo ";
str += "where EmployInfo.rId=RaceInfo.rId and EmployInfo.sId=SectionInfo.sId and JobInfo.jId=EmployInfo.jId and Title.tId=EmployInfo.tId and ";
str += "EndowmentInfo.endId=EmployInfo.endId and MedicalInfo.meId=EmployInfo.meId and WagesInfo.waId=EmployInfo.waId and EmployInfo.eId=" + int.Parse(empInfoForm.eif.ID);
Base bb = new Base();
DataTable table = new DataTable();
table = bb.ExeSQLdt(str);
this.RaceId_txt.Text = table.Rows[0]["rId"].ToString();
this.SectionId_txt.Text = table.Rows[0]["sId"].ToString();
this.TitleId_txt.Text = table.Rows[0]["tId"].ToString();
this.JobId_txt.Text = table.Rows[0]["jId"].ToString();
this.No_txt.Text = table.Rows[0]["员工编号"].ToString();
this.Name_txt.Text = table.Rows[0]["员工姓名"].ToString();
this.Sex_cb.Text = table.Rows[0]["性别"].ToString();
this.Party_cb.Text = table.Rows[0]["党派"].ToString();
this.Marrige_cb.Text = table.Rows[0]["婚否"].ToString();
this.Race_cb.Text = table.Rows[0]["民族"].ToString();
this.Birth_dtp.Text = table.Rows[0]["出生日期"].ToString();
this.Number_txt.Text = table.Rows[0]["身份证号"].ToString();
this.Place_cb.Text = table.Rows[0]["籍贯"].ToString();
this.Phone_txt.Text = table.Rows[0]["联系电话"].ToString();
this.Adress_txt.Text = table.Rows[0]["联系地址"].ToString();
this.Edu_cb.Text = table.Rows[0]["学历"].ToString();
this.Pro_cb.Text = table.Rows[0]["专业"].ToString();
this.Degree_cb.Text = table.Rows[0]["学位"].ToString();
this.School_txt.Text = table.Rows[0]["毕业学校"].ToString();
this.LeaveSchool_dtp.Text = table.Rows[0]["毕业时间"].ToString();
this.EmpTime_dtp.Text = table.Rows[0]["聘用时间"].ToString();
this.EmpType_cb.Text = table.Rows[0]["聘用方式"].ToString();
this.Source_cb.Text = table.Rows[0]["聘用来源"].ToString();
this.App_cb.Text = table.Rows[0]["员工状态"].ToString();
this.Section_cb.Text = table.Rows[0]["所在部门"].ToString();
this.Job_cb.Text = table.Rows[0]["所任职务"].ToString();
this.Title_cb.Text = table.Rows[0]["所获职称"].ToString();
this.EenMen_txt.Text = table.Rows[0]["养老保险号"].ToString();
this.Med_txt.Text = table.Rows[0]["医疗保险号"].ToString();
this.Wa_txt.Text = table.Rows[0]["工资号"].ToString();
}
#endregion
#region 取消
private void button2_Click(object sender, System.EventArgs e)
{
empInfoForm.eif.Enabled = true;
empInfoForm.eif.DBDataGrid();
this.Close();
}
#endregion
#region 窗体关闭时把empInfoForm窗体设为活动
private void AddForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
empInfoForm.eif.Enabled = true;
empInfoForm.eif.DBDataGrid();
}
#endregion
#region 把民族表绑定到民族下拉列表中
private void DBRace_cb()
{
string str = "select * from RaceInfo";
DataTable dt = new DataTable();
Base bb = new Base();
dt = bb.ExeSQLdt(str);
for(int i = 0 ; i < dt.Rows.Count ; i ++)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -