📄 f_manfile.cs
字号:
MyMC.CityInfo(comboBox2, "select distinct StuffName from tb_Stuffbusic", 0); //职工姓名
tem_Field = "StuffName";
break;
}
case 1: //性别
{
comboBox2.Items.Clear();
comboBox2.Items.Add("男");
comboBox2.Items.Add("女");
tem_Field = "Sex";
break;
}
case 2:
{
MyMC.CoPassData(comboBox2, "tb_Folk"); //民族类别
tem_Field = "Folk";
break;
}
case 3:
{
MyMC.CoPassData(comboBox2, "tb_Kultur"); //文化程度
tem_Field = "Kultur";
break;
}
case 4:
{
MyMC.CoPassData(comboBox2, "tb_Visage"); //正治面貌
tem_Field = "Visage";
break;
}
case 5:
{
MyMC.CoPassData(comboBox2, "tb_EmployeeGenre"); //职工类别
tem_Field = "Employee";
break;
}
case 6:
{
MyMC.CoPassData(comboBox2, "tb_Business"); //职务类别
tem_Field = "Business";
break;
}
case 7:
{
MyMC.CoPassData(comboBox2, "tb_Branch"); //部门类别
tem_Field = "Branch";
break;
}
case 8:
{
MyMC.CoPassData(comboBox2, "tb_Duthcall"); //职称类别
tem_Field = "Duthcall";
break;
}
case 9:
{
MyMC.CoPassData(comboBox2, "tb_Laborage"); //工资类别
tem_Field = "Laborage";
break;
}
}
}
private void N_First_Click(object sender, EventArgs e)
{
try
{
int ColInd = 0;
if (dataGridView1.CurrentCell.ColumnIndex == -1 || dataGridView1.CurrentCell.ColumnIndex > 1)
ColInd = 0;
else
ColInd = dataGridView1.CurrentCell.ColumnIndex;
if ((((Button)sender).Name) == "N_First")
{
dataGridView1.CurrentCell = this.dataGridView1[ColInd, 0];
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 0, 0, 1, 1);
}
if ((((Button)sender).Name) == "N_Previous")
{
if (dataGridView1.CurrentCell.RowIndex == 0)
{
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 0, 0, 1, 1);
}
else
{
dataGridView1.CurrentCell = this.dataGridView1[ColInd, dataGridView1.CurrentCell.RowIndex - 1];
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 1, 1, 1, 1);
}
}
if ((((Button)sender).Name) == "N_Next")
{
if (dataGridView1.CurrentCell.RowIndex == dataGridView1.RowCount - 2)
{
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 1, 1, 0, 0);
}
else
{
dataGridView1.CurrentCell = this.dataGridView1[ColInd, dataGridView1.CurrentCell.RowIndex + 1];
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 1, 1, 1, 1);
}
}
if ((((Button)sender).Name) == "N_Cauda")
{
dataGridView1.CurrentCell = this.dataGridView1[ColInd, dataGridView1.RowCount - 2];
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 1, 1, 0, 0);
}
}
catch { }
}
private void N_Previous_Click(object sender, EventArgs e)
{
N_First_Click(sender, e);
}
private void N_Next_Click(object sender, EventArgs e)
{
N_First_Click(sender, e);
}
private void N_Cauda_Click(object sender, EventArgs e)
{
N_First_Click(sender, e);
}
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
try
{
if (dataGridView1.CurrentCell.RowIndex > -1)
{
textBox1.Text = Grid_Inof(dataGridView1); //显示职工信息表的当前记录
MyMC.Ena_Button(N_First, N_Previous, N_Next, N_Cauda, 1, 1, 1, 1); //使窗体中的编辑按钮可用
//获取工作简历表中的信息
DataSet WDset = MyDataClass.getDataSet("select Sut_ID,ID,BeginDate as 开始时间,EndDate as 结束时间, Branch as 部门, Business as 职务, WordUnit as 工作单位 from tb_WordResume where Sut_ID='" + tem_ID + "'", "tb_WordResume");
MyMC.Correlation_Table(WDset, dataGridView2); //将WDset存储的信息显示在dataGridView2控件中
if (WDset.Tables[0].Rows.Count < 1) //当WDset中没有信息时
//清空相应的控件
MyMC.Clear_Grids(WDset.Tables[0].Columns.Count, groupBox7.Controls, "Word_");
//获取家庭关系表中的信息
DataSet FDset = MyDataClass.getDataSet("select Sut_ID,ID,LeaguerName as 家庭成员名称,Nexus as 与本人的关系, BirthDate as 出生日期, WordUnit as 工作单位, Business as 职务, Visage as 政治面貌, Phone as 电话 from tb_Family where Sut_ID='" + tem_ID + "'", "tb_Family");
MyMC.Correlation_Table(FDset, dataGridView3);
if (FDset.Tables[0].Rows.Count < 1)
MyMC.Clear_Grids(FDset.Tables[0].Columns.Count, groupBox10.Controls, "Famity_");
//获取工作简历表中的信息
DataSet TDset = MyDataClass.getDataSet("select Sut_ID,ID,TrainFashion as 培训方式,BeginDate as 培训开始时间, EndDate as 培训结束时间, Speciality as 培训专业, TrainUnit as 培训单位, KulturMemo as 培训内容, Charge as 费用, Effect as 效果 from tb_TrainNote where Sut_ID='" + tem_ID + "'", "tb_TrainNote");
MyMC.Correlation_Table(TDset, dataGridView4);
if (TDset.Tables[0].Rows.Count < 1)
MyMC.Clear_Grids(TDset.Tables[0].Columns.Count, groupBox12.Controls, "TrainNote_");
//获取奖惩记录表中的信息
DataSet RDset = MyDataClass.getDataSet("select Sut_ID,ID,RPKind as 奖惩种类,RPDate as 奖惩时间, SealMan as 批准人, QuashDate as 撤消时间, QuashWhys as 撤消原因 from tb_RANDP where Sut_ID='" + tem_ID + "'", "tb_RANDP");
MyMC.Correlation_Table(RDset, dataGridView5);
if (RDset.Tables[0].Rows.Count < 1)
MyMC.Clear_Grids(RDset.Tables[0].Columns.Count, groupBox14.Controls, "RANDP_");
//获取个人简历表中的信息
SqlDataReader Read_Memo = MyDataClass.getcom("Select * from tb_Individual where ID='" + tem_ID + "'");
if (Read_Memo.Read())
Ind_Mome.Text = Read_Memo[1].ToString();
else
Ind_Mome.Clear();
//MyMC.Show_DGrid(dataGridView2, groupBox7.Controls, "Word_");
}
}
catch { }
}
private void comboBox2_TextChanged(object sender, EventArgs e)
{
try
{
tem_Value = comboBox2.SelectedItem.ToString();
Condition_Lookup(tem_Value);
}
catch
{
comboBox2.Text = "";
MessageBox.Show("只能以选择方式查询。");
}
}
private void button1_Click(object sender, EventArgs e)
{
tem_Field = "";
MyDS_Grid = MyDataClass.getDataSet(DataClass.MyMeans.AllSql, "tb_Stuffbusic");
dataGridView1.DataSource = MyDS_Grid.Tables[0];
textBox1.Text = Grid_Inof(dataGridView1); //显示职工信息表的当前记录
}
private void Sut_Amend_Click(object sender, EventArgs e)
{
hold_n = 2; //用于记录修改操作的标识
MyMC.Ena_Button(Sut_Add, Sut_Amend, Sut_Cancel, Sut_Save, 0, 0, 1, 1);
groupBox5.Text = "当前正在修改信息";
Img_Clear.Enabled = true; //使图片选择按钮为可用状态
Img_Save.Enabled = true;
}
private void Sut_Cancel_Click(object sender, EventArgs e)
{
hold_n = 0; //恢复原始标识
MyMC.Ena_Button(Sut_Add, Sut_Amend, Sut_Cancel, Sut_Save, 1, 1, 0, 0);
groupBox5.Text = "";
Ima_n = 0;
if (tem_Field == "")
button1_Click(sender, e);
else
Condition_Lookup(tem_Value);
Img_Clear.Enabled = false;
Img_Save.Enabled = false;
}
private void Sut_Save_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedTab.Name == "tabPage6") //如果当前是“个人简历”选项卡
{
//通过MyMeans公共类中的getcom()方法查询当前职工是否添加了个人简历
SqlDataReader Read_Memo = MyDataClass.getcom("Select * from tb_Individual where ID='" + tem_ID + "'");
if (Read_Memo.Read()) //如果有记录
//将当前设置的个人简历进行修改
MyDataClass.getsqlcom("update tb_Individual set Memo='" + Ind_Mome.Text + "' where ID='" + tem_ID + "'");
else
//如果没有记录,则进行添加操作
MyDataClass.getsqlcom("insert into tb_Individual (ID,Memo) values('" + tem_ID + "','" + Ind_Mome.Text + "')");
}
else //如果当前是“职工基本信息”选项卡
{
//定义字符串变量,并存储将“职工基本信息表”中的所有字段
string All_Field = "ID,StuffName,Folk,Birthday,Age,Kultur,Marriage,Sex,Visage,IDCard,Workdate,WorkLength,Employee,Business,Laborage,Branch,Duthcall,Phone,Handset,School,Speciality,GraduateDate,Address,BeAware,City,M_Pay,Bank,Pact_B,Pact_E,Pact_Y";
if (hold_n == 1 || hold_n == 2) //判断当前是添加,还是修改操作
{
ModuleClass.MyModule.ADDs = ""; //清空MyModule公共类中的ADDs变量
//用MyModule公共类中的Part_SaveClass()方法组合添加或修改的SQL语句
MyMC.Part_SaveClass(All_Field, S_0.Text.Trim(), "", tabControl1.TabPages[0].Controls, "S_", "tb_Stuffbusic", 30, hold_n);
//如果ADDs变量不为空,则通过MyMeans公共类中的getsqlcom()方法执行添加、修改操作
if (ModuleClass.MyModule.ADDs != "")
MyDataClass.getsqlcom(ModuleClass.MyModule.ADDs);
}
if (Ima_n > 0) //如果图片标识大于0
{
//通过MyModule公共类中r的SaveImage()方法将图片存入数据库中
MyMC.SaveImage(S_0.Text.Trim(), imgBytesIn);
}
Sut_Cancel_Click(sender, e); //调用“取消”按钮的单击事件
}
}
private void button7_Click(object sender, EventArgs e)
{
Read_Image(openFileDialog1, S_Photo);
Ima_n = 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -