1、2,参考
If e.DataCol.name = "驾证有效期限" Then
If e.NewValue = Nothing Then
e.DataRow("驾证状态") = Nothing
Else
Dim sp As TimeSpan = cdate(e.NewValue) - Date.Today
If sp.TotalDays > 30 Then
e.DataRow("驾证状态") = "正常"
Else If sp.TotalDays >= 0 Then
e.DataRow("驾证状态") = "即将到期请换证"
Else
e.DataRow("驾证状态") = "已过期请换证"
End If
End If
End If
If e.DataCol.name = "从业证有效期限" Then
If e.NewValue = Nothing Then
e.DataRow("从业证状态") = Nothing
Else
Dim sp As TimeSpan = cdate(e.NewValue) - Date.Today
If sp.TotalDays > 30 Then
e.DataRow("从业证状态") = "正常"
Else If sp.TotalDays >= 0 Then
e.DataRow("从业证状态") = "即将到期请换证"
Else
e.DataRow("从业证状态") = "已过期请换证"
End If
End If
End If
If e.DataCol.name = "继续教育记录" Then
Dim sp As TimeSpan = cdate(e.NewValue) - Date.Today
If sp.TotalDays >= 0 AndAlso sp.TotalDays <= 30 Then
e.DataRow("从业证状态") = "请参加继续教育"
End If
End If