Select Case e.DataCol.name
Case "职级_任现职级时间"
If e.DataRow.IsNull("职级_任现职级时间") Then
e.DataRow("职级_任现职级年限") = Nothing
Else
Dim d() As String = e.DataRow("职级_任现职级时间").Split("-")
If CInt(d(1)) < 1 OrElse CInt(d(1)) > 12 Then
magbox("非法日期")
Return
End If
Dim tp As TimeSpan = Date.today - CDate(e.DataRow("职级_任现职级时间"))
e.DataRow("职级_任现职级年限") = Math.Round(tp.TotalDays / 365.2422,2)
End If
End Select