Foxtable(狐表)用户栏目专家坐堂 → 自定义函数问题


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

主题:自定义函数问题

帅哥哟,离线,有人找我吗?
大红袍
  21楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/8 17:02:00 [只看该作者]

 

[此贴子已经被作者于2015/5/8 17:07:13编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  22楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/8 17:07:00 [只看该作者]

这样改

 

Dim oldV = args(0)
Dim newV = args(1)
Dim r As Row = CurrentTable.Current
Dim colIndex As Integer = CurrentTable.ColSel
Dim colName As String = CurrentTable.Cols(colIndex).Name
For Each dt As DataTable In DataTables
    If dt.DataCols.Contains(ColName) Then
        If dt.DataCols(ColName).IsBoolean Then
            For Each dr As DataRow In dt.Select("[" & colName & "] = " & oldV)
                dr(colName) = newV
            Next
        ElseIf dt.DataCols(ColName).IsDate Then
            For Each dr As DataRow In dt.Select("[" & colName & "] = #" & oldV & "#")
                dr(colName) = newV
            Next
        ElseIf dt.DataCols(ColName).IsNumeric Then
            For Each dr As DataRow In dt.Select("[" & colName & "] = " & oldV)
                dr(colName) = newV
            Next
        ElseIf dt.DataCols(ColName).IsString Then
            For Each dr As DataRow In dt.Select("[" & colName & "] = '" & oldV & "'")
                dr(colName) = newV
            Next
        End If
    End If
    dt.Save
Next


 回到顶部
总数 22 上一页 1 2 3