请问下各位老师:
目前的状况是,我每按一次按钮 检测项目 都会添加一次,按多次就一直重复添加
请问要怎样才能按多次按钮时不重复添加 检测项目
对于每个样品编号都只有一个唯一的检测项目
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("样品编号")
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