Select Case e.DataCol.name
Case "入职日期","离职日期"
If e.DataRow.IsNull("入职日期") Then
e.DataRow("工龄_年") = Nothing
e.DataRow("工龄_月") = Nothing
e.DataRow("工龄_日") = Nothing
Else
Dim y,m,d As Integer
DateYMD(e.DataRow("入职日期"),Date.Today,y,m,d)
e.DataRow("工龄_年") = y
e.DataRow("工龄_月") = m
e.DataRow("工龄_日") = d
End If
End Select
If e.DataRow.IsNull("离职日期") Then
e.DataRow("工龄_年") = Nothing
e.DataRow("工龄_月") = Nothing
e.DataRow("工龄_日") = Nothing
Else
Dim y,m,d As Integer
DateYMD(e.DataRow("入职日期"),Date.Today,y,m,d)
e.DataRow("工龄_年") = y
e.DataRow("工龄_月") = m
e.DataRow("工龄_日") = d
End If
End Select
e.DataRow("状态") = "在职"
Else
e.DataRow("工龄_年") = Nothing
e.DataRow("工龄_月") = Nothing
e.DataRow("工龄_日") = Nothing
Else
Dim y,m,d As Integer
DateYMD(e.DataRow("入职日期"),Date.Today,y,m,d)
e.DataRow("工龄_年") = y
e.DataRow("工龄_月") = m
e.DataRow("工龄_日") = d
End If
End Select
e.DataRow("状态") = "离职"
End If
End If
End Select
If e.DataCol.Name = "离职日期" Then
If e.DataRow.isnull("离职日期") = False Then
e.DataRow("状态") = "离职"
Else
e.DataRow("状态") = "在职"
End If
End If