以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何增加条件问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=189031)

--  作者:lin98
--  发布时间:2023/11/6 18:30:00
--  如何增加条件问题
Dim dr As Row = Tables("登记窗口_Table1").Current \'
If dr Is Nothing Then

Else
    Dim r As Row = Tables("引用窗口_Table1").Current \'

\'Dim r As DataRow In DataTables("引用窗口_Table1").Selec-t("[选中] = true ")\'

    Dim Cols1() As String = {"姓名", "代号"} \'
    Dim Cols2() As String = {"部门", "下属"} \'
    For i As Integer = 0 To Cols1.Length - 1
        dr(Cols2(i)) = r(Cols1(i))
    Next
End If

需求:如何加上条件,选中列选中后执行?

--  作者:有点蓝
--  发布时间:2023/11/6 20:37:00
--  
Dim dr As Row = Tables("登记窗口_Table1").Current \'
If dr Is Nothing Then

Else
    Dim r As Row = Tables("引用窗口_Table1").Current \'

for each r2 As DataRow In DataTables("引用窗口_Table1").Select("[选中] = true ")\'

    Dim Cols1() As String = {"姓名", "代号"} \'
    Dim Cols2() As String = {"部门", "下属"} \'
    For i As Integer = 0 To Cols1.Length - 1
        r2(Cols2(i)) = r(Cols1(i))
    Next
next
End If