Dim Vals1 As List(of String())
Vals1 = DataTables("凭证辅助信息").GetValues("借方科目编码|贷方科目编码")'其中"贷方科目编码"是多值字段
For i As Integer = 0 To Vals1.Count - 1
For Each dr As DataRow In DataTables("会计凭证导入").DataRows
If dr.IsNull("贷方金额") = False Then
dr("科目编码") = Vals1(i)(1).split(",")(0) '要求是多值字段"贷方科目编码"的第一个科目即科目1
End If
Next
Next
Dim Vals2 As List(of String())
Vals2 = DataTables("凭证辅助信息").GetValues("借方科目编码|贷方科目编码") '其中"贷方科目编码"是多值字段
For i As Integer = 0 To Vals2.Count - 1
For Each dr As DataRow In DataTables("会计凭证导入").DataRows
If dr.IsNull("贷方金额") = False And dr.IsNull("科目编码") = True Then
dim arr() as string = Vals2(i)(2).split(",")
if arr.length > 1
dr("科目编码") = arr(1) '要求是多值字段"贷方科目编码"的第二个科目即科目2
end if
End If
Next
Next