程序一:
If e.DataCol.Name = "客户售达方" Then
If e.DataRow("客户售达方") = Nothing Then
e.DataRow("客户售达方短文本") = Nothing
Else
e.DataRow("客户售达方短文本") = e.DataRow("客户售达方") + e.DataRow("短文本")
End If
End If
程序二:
If e.DataCol.Name = "客户售达方短文本" Then
Dim nms() As String = {"客户名称"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("客户售达方和客户名称对应表").Find("[客户售达方短文本] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
程序三:
If e.DataCol.Name = "凭证日期" Then
If e.DataRow.IsNull("凭证日期") Then
e.DataRow("凭证日期和客户名称") = Nothing
Else
e.DataRow("凭证日期和客户名称") = e.DataRow("凭证日期") + e.DataRow("客户名称")
End If
End If
程序四:
If e.DataCol.Name = "凭证日期和客户名称" Then
Dim nms() As String = {"生产批次"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("生产批次数据源").Find("[凭证日期和客户名称] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If