C#考勤管理系统报告
private void 修改职员信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lvEmp.SelectedItems.Count == 0)
{
return;
}
string eid = lvEmp.SelectedItems[0].Text;
EmpForm form = new EmpForm(OperType.Modify, eid);
form.ShowDialog();
//刷新数据
if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
{
btnQuery_Click(sender, e);
}
}
private void 删除职员信息ToolStripMenuItem_Click(object sender, EventArgs e) {
if (lvEmp.SelectedItems.Count == 0)
{
return;
}
SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString); SqlTransaction tran = null;
if (MessageBox.Show("您确实要删除员工号为" + lvEmp.SelectedItems[0].Text + "的员工信息吗?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
{
try
{
conn.Open();
tran = conn.BeginTransaction();
string commandText = "delete from T_Record where EID='" + lvEmp.SelectedItems[0].Text + "'";
SqlCommand cmd = new SqlCommand(commandText, conn);
cmd.Transaction = tran;
cmd.ExecuteNonQuery();
commandText = "delete from T_Employee where EID='" +
lvEmp.SelectedItems[0].Text + "'";
cmd = new SqlCommand(commandText, conn);
cmd.Transaction = tran;
cmd.ExecuteNonQuery();
http://www.77cn.com.cnmit();
MessageBox.Show("职员删除成功!", "系统提示");
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库C#考勤管理系统报告(10)在线全文阅读。
相关推荐: