法定节日,你还得单独做一个法定节日的表。
基本代码
Dim dt As DataTable = DataTables("出勤相关")
For Each ary() As String In dt.GetValues("部门|当事人", "出勤分类 = '加班'")
Dim sum1 = 0
Dim sum2 = 0
For Each dr As DataRow In dt.Select("部门 = '" & ary(0) & "' and 当事人 = '" & ary(1) & "' and 出勤分类 = '加班'")
Dim d As Date = dr("开始时间")
If d.DayOfWeek >= 1 AndAlso d.DayOfWeek <= 5 Then
sum1 += dr("计划小时数")
Else
sum2 += dr("计划小时数")
End If
Next
Dim ndr As DataRow = DataTables("月度加班汇总").AddNew
ndr("部门") = ary(0)
ndr("姓名") = ary(1)
ndr("加班H数一倍半") = sum1
ndr("加班H数二倍") = sum2
Next