Foxtable(狐表)用户栏目专家坐堂 → 截取数字减去10,之后加上汉字,拷贝到另外一表


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

主题:截取数字减去10,之后加上汉字,拷贝到另外一表

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110811 积分:563993 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/23 17:11:00 [显示全部帖子]

Dim ns As new List(of String)
ns.AddRange(new String() {"成人","儿童","单房差"})
Dim str As String = "成人2870,儿童2270,单房差770"
Dim arr() As String = str.Split(",")
Dim n As String
Dim p As Double
str = ""
For Each Ar As String In arr
    For Each n1 As String In ns
        If ar.Contains(n1) Then
            n = n1
            Exit For
        End If
    Next
    p = val(ar.Replace(n,"")) - 10
    str &= n & p & ","
Next
Output.Show(str)

具体什么应用到项目里留做作业

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110811 积分:563993 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/23 20:57:00 [显示全部帖子]

Dim dtb As DataTable = DataTables("表b")
Dim dtc As DataTable = DataTables("表c")
Dim ns As new List(of String)
ns.AddRange(new String() {"成人","儿童","单房差"})
For Each dr As DataRow In dtb.DataRows
    Dim str As String = dr("价格")
    Dim arr() As String = str.Split(",")
    Dim n As String
    Dim p As Double
    str = ""
    For Each Ar As String In arr
        For Each n1 As String In ns
            If ar.Contains(n1) Then
                n = n1
                Exit For
            End If
        Next
        p = val(ar.Replace(n,"")) - 10
        str &= n & p & ","
    Next
    Dim ndr As DataRow = dtc.AddNew
    ndr("价格")=str
Next

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110811 积分:563993 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/27 10:37:00 [显示全部帖子]

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("表c", "别人编号|我们编号")
Dim nd = trv.nodes.insert("所有", 0)
For Each n1 As WinForm.TreeNode In trv.nodes
    n1.Checked = True
    For Each n2 As WinForm.TreeNode In n1.Nodes
        n2.Checked = True
    Next
Next
Tables("表c").Filter = ""

 回到顶部