private void dgv_Main_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { blIsUpdate = false; try { switch (intSelectModel) { case 1: #region【人员】 //bcp_EmpTitle.CaptionTitle = "查看员工信息"; //lb_EmpTipsInfo.Visible = false; //隐藏提示信息 //aebll.GetDeptNameCmb(comboBox_EmployeeDepartment); //初始化部门名词(comboBox) //aebll.GetDutyNameCmb(combobox_EmployeeDuty, false); //初始化职务名称(comboBox) //aebll.GetWorkTypeCmb(comboBox_EmpWorkTypeName); //初始化工种名称(comboBox) //comboBox_EmployeeSex.DataSource = aebll.GetEmpSexTab(); //初始化性别(comboBox) //comboBox_EmployeeClan.DataSource = aebll.GetEmpClanTab(); //初始化政治面貌(comboBox) //comboBox_EmployeeWedlock.DataSource = aebll.GetEmpWedlockTab(); //初始化婚姻状况(comboBox) //comboBox_EmployeeSchoolRecord.DataSource = aebll.GetEmpSchoolRecordTab(); //初始化学历(comboBox) //combobox_EmployeeHireType.DataSource = aebll.GetEmpHireTypeTab(); //初始化聘用形式(comboBox) //GetEmpTable(int.Parse(dgv_Main.Rows[e.RowIndex].Cells["EmpID"].Value.ToString())); //pl_AddEmpInfo.Visible = true; tempEmpID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells["EmpID"].Value.ToString()); //bt_AddEmpSave.Enabled = bt_AddEmpReset.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = false; //tbc_EmpInfo.SelectedTab = tbp_EmpBasic; A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this); frmAei.ShowDialog(); #endregion break; case 2: #region【部门】 tempDept_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[7].Value.ToString()); A_FrmEmpInfo_AddDeptInfo frmAdi = new A_FrmEmpInfo_AddDeptInfo(this); frmAdi.ShowDialog(); #endregion break; case 3: #region【职务】 tempDuty_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[4].Value.ToString()); //绑定查看的职务信息 A_FrmEmpInfo_AddDutyInfo frmAdui = new A_FrmEmpInfo_AddDutyInfo(this); frmAdui.ShowDialog(); #endregion break; case 4: #region【工种】 tempWork_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[6].Value.ToString()); //绑定查看的职务信息 A_FrmEmpInfo_AddWorkTypeInfo frmAwt = new A_FrmEmpInfo_AddWorkTypeInfo(this); frmAwt.ShowDialog(); #endregion break; case 5: #region【证书】 tempCer_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[4].Value.ToString()); A_FrmEmpInfo_AddCerInfo frmAdc = new A_FrmEmpInfo_AddCerInfo(this); frmAdc.ShowDialog(); #endregion break; default: break; } } catch{} }
private void bt_Laws_Click(object sender, EventArgs e) { int i = 0; int intUpDateID = -1; blIsUpdate = true; switch (intSelectModel) { case 1: #region【人员】 try { foreach (DataGridViewRow dgvr in dgv_Main.Rows) { if (dgvr.Cells["cl"].Value != null && int.Parse(dgvr.Cells["cl"].Value.ToString()) == 1) { intUpDateID = Convert.ToInt32(dgvr.Cells["EmpID"].Value.ToString()); i += 1; } } } catch { intUpDateID = -1; i = 0; } if (i == 0) { MessageBox.Show("请选择要修改的员工", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (i > 1) { MessageBox.Show("所选员工不能大于1人,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { tempEmpID = intUpDateID; //GetEmpInfo_Add(); //pl_AddEmpInfo.Visible = true; //bt_AddEmpReset.Enabled = false; //bt_AddEmpSave.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = true; //tbc_EmpInfo.SelectedTab = tbp_EmpBasic; A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this); frmAei.ShowDialog(); } #endregion break; case 2: #region【部门】 try { foreach (DataGridViewRow dgvr in dgv_Main.Rows) { if (dgvr.Cells["cl"].Value != null && int.Parse(dgvr.Cells["cl"].Value.ToString()) == 1) { intUpDateID = Convert.ToInt32(dgvr.Cells[7].Value.ToString()); i += 1; } } } catch { intUpDateID = -1; i = 0; } if (i == 0) { MessageBox.Show("请选择要修改的部门", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (i > 1) { MessageBox.Show("所选部门不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { tempDept_ID = intUpDateID; A_FrmEmpInfo_AddDeptInfo frmAdi = new A_FrmEmpInfo_AddDeptInfo(this); frmAdi.ShowDialog(); } #endregion break; case 3: #region【职务】 try { foreach (DataGridViewRow dgvr in dgv_Main.Rows) { if (dgvr.Cells["cl"].Value != null && int.Parse(dgvr.Cells["cl"].Value.ToString()) == 1) { intUpDateID = Convert.ToInt32(dgvr.Cells[4].Value.ToString()); i += 1; } } } catch { intUpDateID = -1; i = 0; } if (i == 0) { MessageBox.Show("请选择要修改的职务", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (i > 1) { MessageBox.Show("所选职务不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { tempDuty_ID = intUpDateID; A_FrmEmpInfo_AddDutyInfo frmAdi = new A_FrmEmpInfo_AddDutyInfo(this); frmAdi.ShowDialog(); } #endregion break; case 4: #region【工种】 try { foreach (DataGridViewRow dgvr in dgv_Main.Rows) { if (dgvr.Cells["cl"].Value != null && int.Parse(dgvr.Cells["cl"].Value.ToString()) == 1) { intUpDateID = Convert.ToInt32(dgvr.Cells[6].Value.ToString()); i += 1; } } } catch { intUpDateID = -1; i = 0; } if (i == 0) { MessageBox.Show("请选择要修改的工种", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (i > 1) { MessageBox.Show("所选工种不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { tempWork_ID = intUpDateID; A_FrmEmpInfo_AddWorkTypeInfo frmAwt = new A_FrmEmpInfo_AddWorkTypeInfo(this); frmAwt.ShowDialog(); } #endregion break; case 5: #region【证书】 try { foreach (DataGridViewRow dgvr in dgv_Main.Rows) { if (dgvr.Cells["cl"].Value != null && int.Parse(dgvr.Cells["cl"].Value.ToString()) == 1) { intUpDateID = Convert.ToInt32(dgvr.Cells[4].Value.ToString()); i += 1; } } } catch { intUpDateID = -1; i = 0; } if (i == 0) { MessageBox.Show("请选择要修改的证书", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else if (i > 1) { MessageBox.Show("所选证书不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { tempCer_ID = intUpDateID; A_FrmEmpInfo_AddCerInfo frmAdc = new A_FrmEmpInfo_AddCerInfo(this); frmAdc.ShowDialog(); } #endregion break; default: break; } }
private void bt_Add_Click(object sender, EventArgs e) { switch (intSelectModel) { case 1: #region【人员】 //pl_AddEmpInfo.Visible = true; tempEmpID = -1; //GetEmpInfo_Add(); //bt_AddEmpSave.Enabled = bt_AddEmpReset.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = true; //tbc_EmpInfo.SelectedTab = tbp_EmpBasic; A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this); frmAei.ShowDialog(); #endregion break; case 2: #region【部门】 tempDept_ID = -1; A_FrmEmpInfo_AddDeptInfo frmAdi = new A_FrmEmpInfo_AddDeptInfo(this); frmAdi.ShowDialog(); #endregion break; case 3: #region【职务】 tempDuty_ID = -1; A_FrmEmpInfo_AddDutyInfo frmAdui = new A_FrmEmpInfo_AddDutyInfo(this); frmAdui.ShowDialog(); #endregion break; case 4: #region【工种】 tempWork_ID= -1; //GetWorkTypeInfo_Add(); A_FrmEmpInfo_AddWorkTypeInfo frmAwt = new A_FrmEmpInfo_AddWorkTypeInfo(this); frmAwt.ShowDialog(); #endregion break; case 5: #region【证书】 tempCer_ID = -1; A_FrmEmpInfo_AddCerInfo frmAdc = new A_FrmEmpInfo_AddCerInfo(this); frmAdc.ShowDialog(); #endregion break; default: break; } }
private void dgv_Main_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { blIsUpdate = false; try { switch (intSelectModel) { case 1: #region【人员】 //bcp_EmpTitle.CaptionTitle = "查看员工信息"; //lb_EmpTipsInfo.Visible = false; //隐藏提示信息 //aebll.GetDeptNameCmb(comboBox_EmployeeDepartment); //初始化部门名词(comboBox) //aebll.GetDutyNameCmb(combobox_EmployeeDuty, false); //初始化职务名称(comboBox) //aebll.GetWorkTypeCmb(comboBox_EmpWorkTypeName); //初始化工种名称(comboBox) //comboBox_EmployeeSex.DataSource = aebll.GetEmpSexTab(); //初始化性别(comboBox) //comboBox_EmployeeClan.DataSource = aebll.GetEmpClanTab(); //初始化政治面貌(comboBox) //comboBox_EmployeeWedlock.DataSource = aebll.GetEmpWedlockTab(); //初始化婚姻状况(comboBox) //comboBox_EmployeeSchoolRecord.DataSource = aebll.GetEmpSchoolRecordTab(); //初始化学历(comboBox) //combobox_EmployeeHireType.DataSource = aebll.GetEmpHireTypeTab(); //初始化聘用形式(comboBox) //GetEmpTable(int.Parse(dgv_Main.Rows[e.RowIndex].Cells["EmpID"].Value.ToString())); //pl_AddEmpInfo.Visible = true; tempEmpID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells["EmpID"].Value.ToString()); //bt_AddEmpSave.Enabled = bt_AddEmpReset.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = false; //tbc_EmpInfo.SelectedTab = tbp_EmpBasic; A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this); frmAei.ShowDialog(); #endregion break; case 2: #region【部门】 tempDept_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[7].Value.ToString()); A_FrmEmpInfo_AddDeptInfo frmAdi = new A_FrmEmpInfo_AddDeptInfo(this); frmAdi.ShowDialog(); #endregion break; case 3: #region【职务】 tempDuty_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[4].Value.ToString()); //绑定查看的职务信息 A_FrmEmpInfo_AddDutyInfo frmAdui = new A_FrmEmpInfo_AddDutyInfo(this); frmAdui.ShowDialog(); #endregion break; case 4: #region【工种】 tempWork_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[6].Value.ToString()); //绑定查看的职务信息 A_FrmEmpInfo_AddWorkTypeInfo frmAwt = new A_FrmEmpInfo_AddWorkTypeInfo(this); frmAwt.ShowDialog(); #endregion break; case 5: #region【证书】 tempCer_ID = int.Parse(dgv_Main.Rows[e.RowIndex].Cells[4].Value.ToString()); A_FrmEmpInfo_AddCerInfo frmAdc = new A_FrmEmpInfo_AddCerInfo(this); frmAdc.ShowDialog(); #endregion break; default: break; } } catch {} }
private void bt_Add_Click(object sender, EventArgs e) { switch (intSelectModel) { case 1: #region【人员】 //pl_AddEmpInfo.Visible = true; tempEmpID = -1; //GetEmpInfo_Add(); //bt_AddEmpSave.Enabled = bt_AddEmpReset.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = true; //tbc_EmpInfo.SelectedTab = tbp_EmpBasic; A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this); frmAei.ShowDialog(); #endregion break; case 2: #region【部门】 tempDept_ID = -1; A_FrmEmpInfo_AddDeptInfo frmAdi = new A_FrmEmpInfo_AddDeptInfo(this); frmAdi.ShowDialog(); #endregion break; case 3: #region【职务】 tempDuty_ID = -1; A_FrmEmpInfo_AddDutyInfo frmAdui = new A_FrmEmpInfo_AddDutyInfo(this); frmAdui.ShowDialog(); #endregion break; case 4: #region【工种】 tempWork_ID = -1; //GetWorkTypeInfo_Add(); A_FrmEmpInfo_AddWorkTypeInfo frmAwt = new A_FrmEmpInfo_AddWorkTypeInfo(this); frmAwt.ShowDialog(); #endregion break; case 5: #region【证书】 tempCer_ID = -1; A_FrmEmpInfo_AddCerInfo frmAdc = new A_FrmEmpInfo_AddCerInfo(this); frmAdc.ShowDialog(); #endregion break; default: break; } }