Select Case e.Link.Name Case "计算总分排名" Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select(" ", "总分 DESC") For n As integer = 0 To drs.Count - 1 '遍历所有行 If n > 0 AndAlso drs(n)("总分") = drs(n-1)("总分") Then '如果总分和上一行相同 drs(n)("总分录取排名") = drs(n-1)("总分录取排名") '则排名等于上一行 Else drs(n)("总分录取排名") = n + 1 '设置排名 End If Next Case "考点分析" if MessageBox.Show("创建考点信息统计表吗?确认点是,取消点否.", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)= DialogResult.Yes then StatusBar.Message1= "正在创建表格" Dim dtb As New DataTableBuilder("考点信息") dtb.TableVisible= true dtb.AddDef("考点单位", GetType(String), 8) dtb.AddDef("报名单位", GetType(String), 8) dtb.AddDef("参考人数", GetType(Double)) dtb.AddDef("起号", GetType(Double),"","考试起止_起号") dtb.AddDef("止号", GetType(Double),"","考试起止_止号") dtb.AddDef("考点人数", GetType(Double)) dtb.AddDef("考场数", GetType(Double)) dtb.AddDef("一号监考员派出单位", GetType(String),20) dtb.AddDef("二号监考员派出单位", GetType(String),20) dtb.Build() StatusBar.Message1= "正在统计" MainTable= Tables("考点信息") DataTables("考点信息").StopRedraw dim f As New Filler f.SourceTable = DataTables("中招报名数据") '指定数据来源 f.SourceCols = "就读学校" '指定数据来源列 f.DataTable = DataTables("考点信息") '指定数据接收表 f.DataCols = "报名单位" '指定数据接收列 f.Append = false f.Fill() '填充数据 For Each dr as datarow in DataTables("考点信息").Datarows dr("考点单位") = DataTables("中招报名数据").Find("[就读学校] = '" & dr("报名单位") & "'")("考点") dr("参考人数") = DataTables("中招报名数据").Compute("count(姓名)" , "[就读学校] = '" & dr("报名单位") & "'") dr("起号") = DataTables("中招报名数据").Compute("min(准考证号)" , "[就读学校] = '" & dr("报名单位") & "'") dr("止号") = DataTables("中招报名数据").Compute("max(准考证号)" , "[就读学校] = '" & dr("报名单位") & "'") dr("考点人数") = DataTables("中招报名数据").Compute("count(姓名)" , "[考点] = '" & dr("考点单位") & "'") next For Each dr as datarow in DataTables("考点信息").Datarows dr("考场数") = DataTables("中招报名数据").Compute("max(考场)" , "[考点] = '" & dr("考点单位") & "'") next With Tables("考点信息") .Redraw = False .MergeMode = MergeModeEnum.Free .MergeCols.Clear() .MergeCols.Add("考点单位") .MergeCols.Add("考点人数") .MergeCols.Add("考场数") .MergeSort = "" .AllowMerge = True .Redraw = True End With Tables("考点信息").Sort = "起号" Tables("考点信息").SetHeaderRowHeight(30,30) StatusBar.Message1= "统计完毕,请检验-张玉良制作" DataTables("考点信息").ResumeRedraw end if Case "自动录取" DataTables("中招报名数据").StopRedraw For Each lq As DataRow in DataTables("中招报名数据").DataRows lq("录取学校") = nothing lq("录取说明") = nothing lq("录取排名") = nothing next dim xms() as string = {"梁平中学","红旗中学","第一中学"} For Each xm As String In xms '获得该班级的全部行,按总分降序排序 Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[实验班志愿] = '" & xm & "'and [报考类别] = '普通高中 '", "总分 DESC") For n As integer = 0 To drs.Count - 1 '遍历所有行 drs(n)("录取排名") = n + 1 '设置排名 Next Next Dim zf as Integer For Each xm as string in xms if xm = "梁平中学" then zf = DataTables("中招报名数据").Compute("Sum(总分)", "[实验班志愿] = '梁平中学'and [报考类别] = '普通高中 'and [录取排名] = 420 ") elseif xm = "红旗中学" then zf = DataTables("中招报名数据").Compute("Sum(总分)", "[实验班志愿] = '红旗中学'and [报考类别] = '普通高中 'and [录取排名] = 280 ") elseif xm = "第一中学" then zf = DataTables("中招报名数据").Compute("Sum(总分)", "[实验班志愿] = '第一中学'and [报考类别] = '普通高中 'and [录取排名] = 180 ") end if Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[实验班志愿] = '" & xm & "'and [报考类别] = '普通高中 'and [总分] >= '" & zf & "'") For Each dr as DataRow in drs dr("录取学校") = xm dr("录取说明") = "第一批实验班" next next for each pdr as DataRow in datatables("普通高中录取情况").datarows pdr("实验班录取名额") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '" & pdr("普通高中招生学校") & "' and [录取说明] = '第一批实验班 '") pdr("实验班最低录取分数") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '" & pdr("普通高中招生学校") & "' and [录取说明] = '第一批实验班 '") next For Each lq as DataRow in DataTables("中招报名数据").DataRows lq("录取排名") = nothing next dim xm1s() as string = {"梁平中学","红旗中学","第一中学","实验中学","屏锦中学","袁驿中学","福禄中学"} For Each xm1 As String In xm1s '获得该班级的全部行,按总分降序排序 Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[普通班志愿] = '" & xm1 & "'and [报考类别] = '普通高中 'and [录取学校] is null ", "总分 DESC") For n As integer = 0 To drs.Count - 1 '遍历所有行 drs(n)("录取排名") = n + 1 '设置排名 Next Next Dim zf1 as Integer For Each xm1 as string in xm1s if xm1 = "梁平中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '梁平中学'and [报考类别] = '普通高中 'and [录取排名] = 210 ") elseif xm1 = "红旗中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '红旗中学'and [报考类别] = '普通高中 'and [录取排名] = 280 ") elseif xm1 = "第一中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '第一中学'and [报考类别] = '普通高中 'and [录取排名] = 170 ") elseif xm1 = "实验中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '实验中学'and [报考类别] = '普通高中 'and [录取排名] = 120 ") elseif xm1 = "屏锦中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '屏锦中学'and [报考类别] = '普通高中 'and [录取排名] = 220 ") elseif xm1 = "袁驿中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '袁驿中学'and [报考类别] = '普通高中 'and [录取排名] = 70 ") elseif xm1 = "福禄中学" then zf1 = DataTables("中招报名数据").Compute("Sum(总分)", "[普通班志愿] = '福禄中学'and [报考类别] = '普通高中 'and [录取排名] = 70 ") end if Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[普通班志愿] = '" & xm1 & "'and [报考类别] = '普通高中 'and [总分] >= '" & zf1 & "'and [录取学校] is null") For Each dr as DataRow in drs dr("录取学校") = xm1 dr("录取说明") = "第二批第一类" next next for each pdr as DataRow in datatables("普通高中录取情况").datarows pdr("普通班第一批录取名额") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '" & pdr("普通高中招生学校") & "' and [录取说明] = '第二批第一类 '") pdr("普通高第一批最低录取分数") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '" & pdr("普通高中招生学校") & "' and [录取说明] = '第二批第一类 '") next For Each lq as DataRow in DataTables("中招报名数据").DataRows lq("录取排名") = nothing next dim xm2s() as string = {"梁平中学","红旗中学","第一中学","实验中学","屏锦中学","袁驿中学","福禄中学"} Dim jdxxs As List(Of String) = DataTables("中招报名数据").GetUniqueValues("","就读学校") For Each jdxx As String In jdxxs For Each xm2 As String In xm2s '获得该班级的全部行,按总分降序排序 Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[就读学校] = '" & jdxx & "' and [普通班志愿] = '" & xm2 & "'and [报考类别] = '普通高中 'and [录取学校] is null ", "总分 DESC") For n As integer = 0 To drs.Count - 1 '遍历所有行 drs(n)("录取排名") = n + 1 '设置排名 Next Next next dim xm3s() as string = {"梁平中学","红旗中学","第一中学","实验中学","屏锦中学","袁驿中学","福禄中学"} For Each xm3 As String In xm3s For Each hs as DataRow in DataTables("指标分配").Datarows dim tj as Integer dim tj1 as Integer = DataTables("中招报名数据").Select("[就读学校] = '" & hs("参考单位") & "'and [普通班志愿] = '" & xm3 & "'and [报考类别] = '普通高中 'and [录取学校] is null ").count if tj1 > hs(xm3) then tj = DataTables("中招报名数据").Compute("Sum(总分)"," [就读学校] = '" & hs("参考单位") & "'and [录取学校] is null and [录取排名] = '" & hs(xm3) & "'and [普通班志愿] = '" & xm3 & "'and [报考类别] = '普通高中 '") else tj = DataTables("中招报名数据").Compute("Sum(总分)"," [就读学校] = '" & hs("参考单位") & "'and [录取学校] is null and [录取排名] = '" & tj1 & "'and [普通班志愿] = '" & xm3 & "'and [报考类别] = '普通高中 '") end if if xm3 = "梁平中学" orelse xm3 = "红旗中学" then Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[就读学校] = '" & hs("参考单位") & "'and [普通班志愿] = '" & xm3 & "'and [报考类别] = '普通高中 'and [录取学校] is null and [总分] >= '" & tj & "'and [总分名次] <= 3500 ") For Each dr as DataRow in drs dr("录取学校") = xm3 dr("录取说明") = "第二批第二类" next else Dim drs As List(Of DataRow) = DataTables("中招报名数据").Select("[就读学校] = '" & hs("参考单位") & "'and [普通班志愿] = '" & xm3 & "'and [报考类别] = '普通高中 'and [录取学校] is null and [总分] >= '" & tj & "'and [总分名次] <= 5300 ") For Each dr as DataRow in drs dr("录取学校") = xm3 dr("录取说明") = "第二批第二类" next end if next next for each pdr as DataRow in datatables("指标分配").datarows pdr("梁平中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '梁平中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("梁平中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '梁平中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("红旗中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '红旗中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("红旗中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '红旗中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("第一中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '第一中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("第一中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '第一中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("实验中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '实验中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("实验中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '实验中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("屏锦中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '屏锦中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("屏锦中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '屏锦中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("袁驿中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '袁驿中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("袁驿中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '袁驿中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("福禄中学实录") = DataTables("中招报名数据").Compute("count(姓名)", "[录取学校] = '福禄中学' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") pdr("福禄中学最低录取线") = DataTables("中招报名数据").Compute("min(总分)", "[录取学校] = '福禄中学 ' and [录取说明] = '第二批第二类 ' and [就读学校] = '" & pdr("参考单位") & "'") next DataTables("中招报名数据").ResumeRedraw Case "标准录取" End Select
|