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


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

主题:排号

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


加好友 发短信
等级:八尾狐 帖子:1936 积分:14844 威望:0 精华:0 注册:2016/4/28 9:58:00
排号  发帖心情 Post By:2019/6/14 10:51:00 [显示全部帖子]

Dim dt2 As Table = Tables("初中报名_table2")
Dim c4 As String = e.Form.Controls("combobox4").text
Dim c7 As String = e.Form.Controls("combobox7").text
Dim drcj As String = c7 & "成绩"
Dim rb3 As WinForm.RadioButton = e.Form.Controls("RadioButton3")
Dim rb4 As WinForm.RadioButton = e.Form.Controls("RadioButton4")
If dt2.Rows.Count>0
    If c4 > "" And c7>""
        Dim p As WinForm.ProgressBar
        p = e.Form.Controls("ProgressBar1")
        p.Maximum = dt2.rows.Count'设置最大值
        p.Minimum = 0 '设置最小值
        p.Value = 0 '设置当前值
        Dim i As Integer=0
        Dim Arys As List(Of String)  = DataTables("学生信息").GetValues("年级")
        Dim n As Integer=0
        For Each ary As String In arys
            Dim  lbs As List(Of DataRow)
            If rb3.checked=True
                lbs= DataTables("学生信息").Select("年级 ='" & ary & "'",drcj & " desc")
            End If
             If rb4.checked=True
                lbs = DataTables("学生信息").S    elect("年级 ='" & ary & "'",drcj)
            End If
            n=0
            For Each lb As DataRow In lbs
                Dim dr As DataRow = DataTables("成绩").find("身份证件号='" & lb("身份证件号") & "'")
                If dr Is Nothing Then dr = DataTables("成绩").AddNew()
                dr("学段") = "初中"
                dr("班级全称")= lb("班级")
                dr("考试名称")=c4
                dr("身份证件号")=lb("身份证件号")
                dr("单位名称")=_usergroup
                dr("姓名")= lb("学生姓名")
                i=i+1
                p.value=i
                dr("考号")=dr("年级代码") & dr("学校代码") & Format(n+1,"0000")
                n=n+1
            Next
        Next
        Forms("初中报名").Controls("Label2").text = "学生考号表" & dt2.Rows.count & "人"
        Forms("初中报名").Controls("Label14").text = "学生考号表" & dt2.Rows.count & "人"
        Dim dt1 As DataTable = DataTables("成绩")
        Dim cb1 As WinForm.ComboBox = e.form.Controls("ComboBox1")
        cb1.ComboList =" |" & dt1.GetComboListString("年级")
        p.value=0
    Else
        messagebox.show("请选择好本次考试名称和要克隆考试名称","提示",MessageBoxButtons.OK)
    End If
Else
    messagebox.show("请选择好本次要参考的学生")
End If


老师,请问我想将这个代码改进为按成绩排的同时交替同年级班级,即1班成绩最高的排1号,2班成绩最高的排2班,然后依次循环

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


加好友 发短信
等级:八尾狐 帖子:1936 积分:14844 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2019/6/14 11:28:00 [显示全部帖子]

这个就研究不出来了,请老师帮改研究下,谢谢

 回到顶部