1、
If e.DataCol.Name.contains("截止日期") Then
Dim dr As DataRow = e.DataRow
If dr.IsNull(e.DataCol.Name) Then
Else
Dim d As Date = "2018-1-1"
Dim d1 As Date = dr(e.datacol.name)
If d1 >= d Then
e.datarow("备注1") = "长期有效"
End If
End If
End If
2、
If e.DataCol.Name.contains("截止日期") OrElse e.DataCol.name = "出生年月" Then
Dim dr As DataRow = e.DataRow
If dr.IsNull(e.DataCol.Name) orElse dr.IsNull("出生年月") Then
Else
Dim d As Date = dr("出生年月")
Dim d1 As Date = dr(e.datacol.name)
Dim y As Integer = d.year
Dim nl As Integer
If format(d, "MMdd") <= Format(d1, "MMdd") Then
nl = d1.year - y
Else
nl = d1.Year - y -1
End If
If nl >= 50 Then e.datarow("备注2") = "年满50周岁"
End If
End If