If e.DataCol.Name = "口岸" Then
If e.NewValue
Is Nothing Then
e.datarow("开始箱号") = Nothing
Else
Dim dr As DataRow = DataTables("装箱单").Find("[订单号] = '"
&
e.datarow("订单号") &
"' And [口岸] = '"
&
e.NewValue
&
"' And [结束箱号] > 0","_identify Desc")
if dr
IsNot Nothing Then
e.datarow("开始箱号") = dr("结束箱号")+1
End if
End if
ElseIf e.DataCol.Name = "开始箱号" OrElse e.Datacol.Name = "箱数" Then
If e.Datarow.IsNull("开始箱号") = False AndAlso e.Datarow.IsNull("箱数") = False Then
e.DataRow("结束箱号") = e.DataRow("开始箱号") +e.DataRow("箱数") -1
End If
End if