1.周末可以通过时间计算,节假日需要自己用一个表格存储
Select Case e.Col.Name
Case "日期"
If e.Row.IsNull("日期") = False Then
Dim d As Date = e.Row("日期")
If d.DayOfWeek = 0 OrElse d.DayOfWeek = 6 Then
e.Style="样式1"
End If
End If
End Select
3.时间计算参考
DataColChanged事件
Select Case e.DataCol.Name
Case "签到时间"
If e.DataRow.IsNull(e.DataCol.Name) = False AndAlso e.DataRow.IsNull("上班时间") Then
Dim ts As TimeSpan = e.DataRow(e.DataCol.Name) - e.DataRow("上班时间")
If ts.TotalMinutes > 0 Then e.DataRow("迟到时间") = ts.TotalMinutes
End If
Case "签退时间"
If e.DataRow.IsNull(e.DataCol.Name) = False Then
Dim ts As TimeSpan
If e.DataRow.IsNull("下班时间") Then
ts = e.DataRow(e.DataCol.Name) - e.DataRow("下班时间")
If ts.TotalMinutes < 0 Then e.DataRow("早退时间") = ts.TotalMinutes
End If
Dim d As Date = #18:30#
ts = Cdate(e.DataRow(e.DataCol.Name)) - d
If ts.TotalMinutes > 0 Then e.DataRow("加班时间") = ts.TotalMinutes
End If
End Select
有了时间费用计算完全是小学数学,就不说了