If e.DataCol.Name = "编号"
If e.DataRow.IsNull("编号") = True Then
DataTables("双休加班").DeleteFor("编号='" & e.DataRow("编号") & "'")
Else
For Each dc As DataCol In e.DataTable.DataCols
If dc.Name.StartsWith("考勤日期_") AndAlso dc.Name.EndsWith("_小时") = False Then
Dim day As Integer = cint(dc.Name.Split("_")(1))
Dim ndr1 As DataRow = DataTables("双休加班").Find("编号='" & e.DataRow("编号") & "'")
If ndr1 Is Nothing Then
Dim ndr As Row = Tables("双休加班").AddNew
ndr("编号") = e.DataRow("编号")
ndr("考勤年份") = e.DataRow("考勤年份")
ndr("考勤月份") = e.DataRow("考勤月份")
ndr("班组") = e.DataRow("班组")
ndr("用工性质") = e.DataRow("用工性质")
ndr("姓名") = e.DataRow("姓名")
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = False OrElse e.DataRow("考勤日期_" & day & "_休息日") <> "周末" Then
ndr("考勤日期_" & day & "_小时") = Nothing
Else
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = True AndAlso e.DataRow("考勤日期_" & day & "_休息日") = "周末" AndAlso e.DataRow.IsNull("考勤日期_" & day & "_小时") = True Then
ndr("考勤日期_" & day & "_小时") = "8"
End If
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = True AndAlso e.DataRow("考勤日期_" & day & "_休息日") = "周末" AndAlso e.DataRow.IsNull("考勤日期_" & day & "_小时") = False Then
ndr("考勤日期_" & day & "_小时") = e.DataRow("考勤日期_" & day & "_小时")
End If
End If
ndr.Move(0)
End If
End If
Next
End If
ElseIf e.DataRow.Name.StartsWith("考勤日期_") AndAlso e.DataRow.Name.EndsWith("_小时") = False Then
Dim day As Integer = cint(e.DataRow.Name.Split("_")(1))
Dim ndr1 As DataRow = DataTables("双休加班").Find("编号='" & e.DataRow("编号") & "'")
If ndr1 Is Nothing Then
Dim ndr As Row = Tables("双休加班").AddNew
ndr("编号") = e.DataRow("编号")
ndr("考勤年份") = e.DataRow("考勤年份")
ndr("考勤月份") = e.DataRow("考勤月份")
ndr("班组") = e.DataRow("班组")
ndr("用工性质") = e.DataRow("用工性质")
ndr("姓名") = e.DataRow("姓名")
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = False OrElse e.DataRow("考勤日期_" & day & "_休息日") <> "周末" Then
ndr("考勤日期_" & day & "_小时") = Nothing
Else
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = True AndAlso e.DataRow("考勤日期_" & day & "_休息日") = "周末" AndAlso e.DataRow.IsNull("考勤日期_" & day & "_小时") = True Then
ndr("考勤日期_" & day & "_小时") = "8"
End If
If e.DataRow("考勤日期_" & day & "_考勤").Contains("⊕") = True AndAlso e.DataRow("考勤日期_" & day & "_休息日") = "周末" AndAlso e.DataRow.IsNull("考勤日期_" & day & "_小时") = False Then
ndr("考勤日期_" & day & "_小时") = e.DataRow("考勤日期_" & day & "_小时")
End If
End If
ndr.Move(0)
End If
End If