Foxtable(狐表)用户栏目专家坐堂 → 排号


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

主题:排号

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/2/13 17:18:00 [显示全部帖子]

Dim dt As DataTable = DataTables("zk")
dt.StopRedraw()

Dim kds = dt.GetValues("kdxxdm")
Dim js As Integer = 1
Dim zw As Integer = 0
For Each kd As String In kds
    Dim drs = dt.Select("kdxxdm = '" & kd & "'")
    Dim cnt As Integer = drs.count
    Dim ids(cnt - 1) As Integer
    For i As Integer = 0 To cnt -1
        ids(i) = i
    Next
    For i As Integer = 0 To cnt  '洗牌次数
        Dim id1 As Integer = rand.Next(0,cnt)
        Dim id2 As Integer = rand.Next(0,cnt)
        Dim vid As Integer = ids(id1)
        ids(id1) = ids(id2)
        ids(id2) = vid
    Next
    For i As Integer = 0 To cnt-1
        If zw > 29 Then
            js += 1
            zw = 1
        Else
            zw += 1
        End If
        drs(ids(i))("ksh") = "1802" & Format(js, "000") & Format(zw, "00")
    Next
Next

dt.ResumeRedraw()


 


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/2/13 22:54:00 [显示全部帖子]

Dim dt As DataTable = DataTables("zk")
dt.StopRedraw()

Dim kds = dt.GetValues("kdxxdm")
Dim js As Integer = 1
Dim zw As Integer = 0
For Each kd As String In kds
    js += 1
    zw = 0
    Dim drs = dt.Select("kdxxdm = '" & kd & "'")
    Dim cnt As Integer = drs.count
    Dim ids(cnt - 1) As Integer
    For i As Integer = 0 To cnt -1
        ids(i) = i
    Next
    For i As Integer = 0 To cnt  '洗牌次数
        Dim id1 As Integer = rand.Next(0,cnt)
        Dim id2 As Integer = rand.Next(0,cnt)
        Dim vid As Integer = ids(id1)
        ids(id1) = ids(id2)
        ids(id2) = vid
    Next
    For i As Integer = 0 To cnt-1
        If zw > 29 Then
            js += 1
            zw = 1
        Else
            zw += 1
        End If
        drs(ids(i))("ksh") = "1802" & Format(js, "000") & Format(zw, "00")
    Next
Next

dt.ResumeRedraw()


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/2/14 9:00:00 [显示全部帖子]

Dim dt As DataTable = DataTables("zk")
dt.StopRedraw()

Dim kds = dt.GetValues("kdxxdm")
Dim js As Integer = 1
Dim zw As Integer = 0
For Each kd As String In kds
    js += 1
    zw = 0
    Dim drs = dt.Select("kdxxdm = '" & kd & "'")
    Dim cnt As Integer = drs.count
    Dim ids(cnt - 1) As Integer
    For i As Integer = 0 To cnt -1
        ids(i) = i
    Next
    For i As Integer = 0 To cnt  '洗牌次数
        Dim id1 As Integer = rand.Next(0,cnt)
        Dim id2 As Integer = rand.Next(0,cnt)
        Dim vid As Integer = ids(id1)
        ids(id1) = ids(id2)
        ids(id2) = vid
    Next
    For i As Integer = 0 To cnt-1
        If zw > 29 Then
            If cnt-i+1 > 10 Then
                js += 1
                zw = 1
            Else
                zw += 1
            End If
        Else
            zw += 1
        End If
        drs(ids(i))("ksh") = "1802" & Format(js, "000") & Format(zw, "00")
    Next
Next

dt.ResumeRedraw()


 回到顶部