Select Case e.DataCol.Name
Case "登记时间","消缺时间"
Dim dr As DataRow = e.DataRow
If dr.IsNull("登记时间") Then
dr("入库时长") = Nothing
Else
If dr.IsNull("消缺时间") Then
Dim tp As TimeSpan = Date.Today - dr("登记时间")
dr("入库时长") = tp.TotalDays
Else
Dim tp As TimeSpan = dr("消缺时间") - dr("登记时间")
dr("入库时长") = tp.TotalDays
End If
End If
End Select