以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  不重复转换的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=84478)

--  作者:douglas738888
--  发布时间:2016/5/3 14:48:00
--  不重复转换的问题
老师,前几次指导的代码中,如果删除了标有颜色的代码,按水平行转换垂直行的按钮后,多值能实现转换了,但是又不能实现禁止重复值的增加行

多次点击按钮,每次都增加转换的重复行了。   意思,就是实现多值转换的前提下,已转换的行,再点击下面代码就不再重复转换。      

Dim cs() As String = {"校对程序_校对","审核程序_审核","批准程序_批准"}
Dim r As Row = Tables("表E").Current 
For Each c As String In cs
    If r.IsNull(c) = False Then
        Dim i As Integer \'以下代码功能,当产生第一次转换后,再转换时重复值删除
        Dim nr As Row
        Dim idx As Integer = Tables("表E审批").FindRow("审批流程=\'" & c & "\'") 
   \'If idx >= 0 Then
            \'nr = Tables("表E审批").rows(idx)
        \'Else
            \'nr = Tables("表E审批").addnew
        \'End If
        Dim st() As String = r(c).Split(",")
        For Each s As String In st
            nr = Tables("表E审批").addnew
            nr("审批流程") = c
            nr("审批人员") = s
        Next
    End If
Next

--  作者:大红袍
--  发布时间:2016/5/3 14:53:00
--  
Dim cs() As String = {"校对程序_校对","审核程序_审核","批准程序_批准"}
Dim r As Row = Tables("表E").Current
For Each c As String In cs
    If r.IsNull(c) = False Then
        Dim st() As String = r(c).Split(",")
        For Each s As String In st
            Dim nr As Row
            Dim idx As Integer = Tables("表E审批").FindRow("审批流程=\'" & s & "\'")
            If idx >= 0 Then
                nr = Tables("表E审批").rows(idx)
            Else
                nr = Tables("表E审批").addnew
            End If
            nr("审批流程") = c
            nr("审批人员") = s
        Next
    End If
Next

--  作者:douglas738888
--  发布时间:2016/5/3 15:10:00
--  
还在重复增加行,我上个例子了,请老师看看

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:测试eee.table



--  作者:大红袍
--  发布时间:2016/5/3 15:14:00
--  
Dim cs() As String = {"校对程序_校对","审核程序_审核","批准程序_批准"}
Dim r As Row = Tables("表E").Current
For Each c As String In cs
    If r.IsNull(c) = False Then
        Dim st() As String = r(c).Split(",")
        For Each s As String In st
            Dim nr As Row
            Dim idx As Integer = Tables("表E审批").FindRow("审批流程=\'" & c & "\' and 审批人员 = \'" & s & "\'")
            If idx >= 0 Then
                nr = Tables("表E审批").rows(idx)
            Else
                nr = Tables("表E审批").addnew
            End If
            nr("审批流程") = c
            nr("审批人员") = s
        Next
    End If
Next