Foxtable(狐表)用户栏目专家坐堂 → 关于排考室座位号的问题


  共有4890人关注过本帖平板打印复制链接

主题:关于排考室座位号的问题

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


加好友 发短信
等级:二尾狐 帖子:598 积分:4442 威望:0 精华:0 注册:2016/4/15 22:24:00
关于排考室座位号的问题  发帖心情 Post By:2022/1/19 16:15:00 [只看该作者]

这段代码是自定义考场数,比如总考生160人,分6个考场,这段代码实现001号-004号每个考场27人,005-006号每个考场26人,座位号从001一直排到160。我想实现座位号按每个考场单独排,比如001号考场27人座位号排号01-27,005号考场26人从01-26,请教老师代码如何修改

If Forms("高考排考室").Controls("NumericComboBox1").Value <= 0 Then
    MessageBox.Show("考场号不能小等于零值!","中止操作",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
Else
    Dim f As New Filler
    f.SourceTable = DataTables("高考排考室")
    f.SourceCols = "班级,姓名"
    f.DataTable = DataTables("高考排考室")
    f.DataCols = "班级,姓名"
    f.ExcludeExistValue = True
    f.Fill
    For i As Integer = 0 To CurrentTable.rows.count -1
        CurrentTable.Rows(i)("索引顺序") = Rand.Next(10000)
    Next
    CurrentTable.sort = "索引顺序"
    For b As Integer = 0 To CurrentTable.rows.count -1
        CurrentTable.Rows(b)("考场号") = Format(1 + b Mod e.Form.Controls("NumericComboBox1").Value,"100")
    Next
    CurrentTable.sort = "索引顺序,考场号 Asc"
    '================
    For b As Integer = 0 To CurrentTable.rows.count -1
        CurrentTable.Rows(b)("座位号") = Format(Rand.Next(1000) + b Mod e.Form.Controls("NumericComboBox1").Value,"000")
    Next
[此贴子已经被作者于2022/1/19 16:30:36编辑过]

 回到顶部
总数 72 1 2 3 4 5 6 7 8 下一页