Dim tbl As Table = Tables("委托协议书.样品信息")
Dim jcxm As String = tbl.current("检测项目")=DataTables("检测流程流转记录表").GetComboListString("检测项目","样品编号='" & tbl.current("样品编号") & "'","_SortKey").Replace("|",",")
Dim s As String = Tables("委托协议书.样品信息").current("检测项目")
Dim s1 As String = Tables("委托协议书.样品信息").current("样品编号")
For Each r1 As Row in Tables("委托协议书.样品信息.检测流程流转记录表").Rows
if r1("样品编号") = s1 Then
Messagebox.show("不要重复增加")
Return
End if
next
If s <> "" And s1 <> "" Then
Dim Values() As String = s.split(",")
For i As Integer = 0 To Values.Length - 1
Dim Arys As List(Of String())
Arys = DataTables("项目管理").GetUniqueValues("检测项目 = '" & Values(i) & "'", "检测依据","项目代码")
For Each Ary As String() In Arys
Dim r As Row = Tables("委托协议书.样品信息.检测流程流转记录表").AddNew()
r("样品编号") = s1
r("检测项目") = Values(i)
r("检测依据") = Ary(0)
r("项目代码") = Ary(1)
Next
Next
End If