Select Case e.DataCol.Name
Case "进库日期","出库日期"
Dim dr As DataRow = e.DataRow
If dr.IsNull("进库日期") OrElse dr.IsNull("出库日期") Then
dr("超期天数") = Nothing
Else
Dim tp As TimeSpan = dr("出库日期") - dr("进库日期")
If tp.TotalDays >= 30 Then
dr("超期天数") = tp.TotalDays-30
End If
End If
End Select