📄 frmemplpyeeremove.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace HRP.Personnel
{
public partial class frmEmplpyeeRemove : Form
{
public frmEmplpyeeRemove()
{
InitializeComponent();
}
public string strUserName, strWorkType, strDept, strDuteType, strPostTitle;
BaseClass.SqlClass sqlclass = new HRP.BaseClass.SqlClass();
BaseClass.PersonnelClass personnelclass = new HRP.BaseClass.PersonnelClass();
private void frmEmplpyeeRemove_Load(object sender, EventArgs e)
{
this.Bind();
}
public void Bind()
{
this.txtEmployeeID.Text = "";
this.txtEmployeeName.Text = "";
//部门
this.cbbEmployeeDept.DataSource = sqlclass.SqlDaAd("select DeptName from tb_Dept", "tb_Dept").Tables["tb_Dept"];
this.cbbEmployeeDept.DisplayMember = "DeptName";
//职务
this.cbbEmployeeDutyType.DataSource = sqlclass.SqlDaAd("select Name from tb_DutyType", "tb_DutyType").Tables["tb_DutyType"];
this.cbbEmployeeDutyType.DisplayMember = "Name";
//工种
this.cbbEmployeeWorkType.DataSource = sqlclass.SqlDaAd("select Name from tb_WorkType", "WorkType").Tables["WorkType"];
this.cbbEmployeeWorkType.DisplayMember = "Name";
//职称
this.cbbEmployeePostTitle.DataSource = sqlclass.SqlDaAd("select Name from tb_PostTitle", "tb_PostTitle").Tables["tb_PostTitle"];
this.cbbEmployeePostTitle.DisplayMember = "Name";
//绑定数据
this.dgvEmpleeRemove.DataSource = sqlclass.SqlDaAd("select * from tb_Remove", "tb_Remove").Tables["tb_Remove"];
}
private void btnOpen_Click(object sender, EventArgs e)
{
frmEmployeeRemoveOpen frm_EmployeeRemoveOpen = new frmEmployeeRemoveOpen();
frm_EmployeeRemoveOpen.frmemplpyeeremove = this;
frm_EmployeeRemoveOpen.ShowDialog();
}
private void tlbtnRemove_Click(object sender, EventArgs e)
{
if(txtEmployeeID.Text=="")
{
MessageBox.Show("请选择一个要调动的员工!");
return;
}
this.personnelclass.RemoveAdd(this.txtEmployeeID.Text,this.txtEmployeeName.Text,strWorkType,strDept,strDuteType,strPostTitle,this.cbbEmployeeWorkType.Text,this.cbbEmployeeDept.Text,this.cbbEmployeeDutyType.Text,this.cbbEmployeePostTitle.Text,DateTime.Now,strUserName);
this.Bind();
MessageBox.Show("员工调动成功!");
}
private void tlbtnAll_Click(object sender, EventArgs e)
{
this.Bind();
}
private void tlClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void tlSearch_Click(object sender, EventArgs e)
{
if (this.tlcbbData.Text == "")
{
MessageBox.Show("字段不能为空!");
return;
}
if (this.tltxtKeyWord.Text == "")
{
MessageBox.Show("关键字不能为空!");
return;
}
string strData="";
switch(this.tlcbbData.Text)
{
case "编号":
strData="EmployeeID";
break;
case "姓名":
strData="EmployeeName";
break;
}
this.dgvEmpleeRemove.DataSource = personnelclass.removeSearch(strData, this.tltxtKeyWord.Text).Tables["tb_Remove"];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -