Foxtable(狐表)用户栏目专家坐堂 → [求助]单个抽签的代码,如何更改?


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

主题:[求助]单个抽签的代码,如何更改?

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


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

Dim cr2 As Row = Tables("人员抽取_人员").current
If cr2.IsNull("面试顺序") = False Then
    MessageBox.Show("已抽签完毕,不能再抽取!","温馨提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    'Return
End If


Dim dt As Table = Tables("人员抽取_人员")
Dim ids As new List(of Integer)
For Each r As Row In dt.rows
    ids.Add(r.Index)
Next
For Each r As Row In dt.rows
    If r.IsNull("面试顺序") = False Then
        ids.Remove(r("面试顺序"))
    End If
Next
Dim cnt = ids.count
'For i As Integer = 0 To cnt \ 2 '洗牌次数
    '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

'随机取一个
cr2("面试顺序") =ids(rand.Next(0, ids.count))


 回到顶部