C#考勤管理系统报告
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) {
Application.Exit();
}
(3)统计查看界面:
主要代码: tring commandText = "select d.DName as 部门,r.EID as 职员编号,e.EName as 姓名,r.RecordTime as 记录时间,case when Type=1 then '上班' else '下班' end as '类型'," +
" case when ((IsLate=0 and Type=1) or(IsLate=0 and Type=2)) then '正常' when (IsLate=1 and Type=1) then '迟到' else '早退' end as '状态'"
+
" from T_Record r,T_Employee e,T_Department d where r.EID=e.EID and d.DID=e.DID" + sCon.ToString();
using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString)) {
using (SqlDataAdapter sda = new SqlDataAdapter(commandText, conn)) {
DataSet ds = new DataSet();
sda.Fill(ds);
dgvRecord.DataSource = ds.Tables[0];
}
}
(4)部门维护界面: