Foxtable(狐表)用户栏目专家坐堂 → 数据重复添加


  共有4524人关注过本帖树形打印复制链接

主题:数据重复添加

帅哥哟,离线,有人找我吗?
有点酸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1093 积分:6682 威望:0 精华:0 注册:2013/7/1 9:05:00
  发帖心情 Post By:2014/3/23 9:57:00 [显示全部帖子]

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

 回到顶部