基于PDA的C#的一个考勤系统,是课程设计!
FROM T_Kaoqin
WHERE (F_Stucode = N'" + dt.Rows[i]["F__Stcode"].ToString() + "') AND (F_Lessoncode = N'" + dt.Rows[i]["F_Lessoncode"].ToString() + "')"; comm = new SqlCeCommand(SQL, Conn); comm.ExecuteNonQuery(); dtsub = new DataTable();
da = new SqlCeDataAdapter(comm); da.Fill(dtsub);
for (int j = 0; j < dtsub.Rows.Count; j++) {
switch (dtsub.Rows[j][0].ToString()) {
case "出勤": cq++; break; case "病假": bj++; break; case "迟到": cd++; break; case "事假": sj++; break; case "早退": zt++; break; case "其它": qt++; break; case "旷课": kk++; break; } }
lvi = new ListViewItem(dt.Rows[i]["F__Stcode"].ToString()); lvi.SubItems.Add(dt.Rows[i]["F_Stname"].ToString()); lvi.SubItems.Add(cq.ToString()); lvi.SubItems.Add(bj.ToString()); lvi.SubItems.Add(cd.ToString()); lvi.SubItems.Add(sj.ToString()); lvi.SubItems.Add(zt.ToString()); lvi.SubItems.Add(qt.ToString()); lvi.SubItems.Add(kk.ToString()); listView1.Items.Add(lvi); }
Conn.Close(); } }
private void 考勤统计_Load(object sender, EventArgs e) { try {
SqlCeConnection conn = new SqlCeConnection(ConnStr); conn.Open();
string commStr = " select F_Lcode,F_Lname from T_Lesson "; SqlCeCommand comm = new SqlCeCommand(commStr, conn); comm.ExecuteNonQuery();
SqlCeDataAdapter da = new SqlCeDataAdapter(comm); DataTable dt = new DataTable(); da.Fill(dt); string lststr; int i;
int nIndex = dt.Rows.Count; for (i = 0; i < nIndex; i++) {
lststr =
dt.Rows[i]["F_Lcode"].ToString()+dt.Rows[i]["F_Lname"].ToString() ; comboBox1.Items.Add(lststr); } }
catch { } }
private void menuItem1_Click(object sender, EventArgs e) {
课程登陆 f = new 课程登陆(); f.Show(); }
}