Select Case e.DataCol.Name
Case "是否完成"
If e.NewValue = True
e.DataRow("完成时间") = Date.Now
Else
e.DataRow("完成时间") = Nothing
End If
Case "订单编号"
If e.DataRow.IsNull("订单编号")
e.DataRow("客户编码") = Nothing
Else
Dim dr As DataRow = DataTables("订单").Find("订单编号='" & e.DataRow("订单编号") & "'")
If dr IsNot Nothing
e.DataRow("客户编码") = dr("客户编码")
Else
e.DataRow("客户编码") = Nothing
End If
End If
End Select