Dim c7 As String = trim(e.Form.Controls("combobox7").text)
Dim njdm1 As String = "初中20" & trim(str(val(c7.Substring(0,2))-2)) & "级"
Dim njdm2 As String = "初中20" & trim(str(val(c7.Substring(0,2))-3)) & "级"
DataTables("学生信息").loadfilter = "(年级 = '" & njdm1 & "' or 年级 = '" & njdm2 & "') And 学校名称 = '" & _usergroup & "'"
DataTables("学生信息").load
If js.Contains("教务主任") Then
Dim dt As Table = Tables("中考报名_table5")
If dt.Rows.count>0
Dim dr As DataRow
dr = DataTables("学校信息").sqlFind("单位全称 = '" & _usergroup & "'and 学段 = '初中'" )
If dr IsNot Nothing
Dim bydm As String = left(dr("毕业学校代码"),8)
Dim jm As String = dr("学校班级用简称")
Dim p As WinForm.ProgressBar
p = e.Form.Controls("ProgressBar1")
p.Maximum = dt.Rows.Count '设置最大值
p.Minimum = 0 '设置最小值
p.Value = 0 '设置当前值
Dim dwmc As String = _usergroup
If c7 > ""
Dim Cols1() As String = {"学校名称","学生姓名","班级","年级","身份证件号","学籍号","性别","班级"}
Dim Cols2() As String = {"学校名称","姓名","班级","年级","身份证号","学籍号","性别","级"}
Dim su As Integer = 0
Dim dr2 As DataRow
Dim p1 As Integer = 0
For Each dr1 As Row In dt.Rows
If DataTables("生地报名库").Find("身份证号 = '" & dr1("身份证件号") & "' or 学籍号 = '" & dr1("学籍号") & "'") Is Nothing AndAlso DataTables("生地报名库").sqlFind("身份证号 = '" & dr1("身份证件号") & "' or 学籍号 = '" & dr1("学籍号") & "'") Is Nothing Then
dr2 = DataTables("生地报名库").AddNew()
End If
For i As Integer = 0 To Cols1.Length -1
Select Case i
Case 0,1,5,4,6,7
dr2(Cols2(i)) = trim(dr1(Cols1(i)))
Case 2
Dim c() As Char = {"级", "班"}
Dim str As String = dr1(Cols1(i))
Dim s1() As String = str.Split(c)
dr2(Cols2(i)) = s1(1)
Case 3
Dim year As String = c7.Substring(0,2)
Dim v As Integer = cint(year)
Dim ji As String = c7.Substring(2,1)
Dim j As Integer
If ji = "春"
j = 0
End If
If ji = "秋"
j = 1
End If
dr2(Cols2(i)) = trim(str(v - val(dr1(Cols1(i)).Substring(4,2)) + j +6))
If dr2(Cols2(i)) = "9"
dr2("备注") ="补考"
End If
End Select
dr2("考试名称") = c7
P1 =P1+1
P.VALUE = P1
dr2("学校班级") = jm & dr2("年级") & "." & dr2("班级")
Next
Next
If messagebox.show("是否进行重复情况查询","提示",MessageBoxButtons.YesNo) =DialogResult.Yes
Dim xcf As Integer = 0
For Each r As Row In Tables("中考报名_table4")
Dim dr4 As DataRow = DataTables("生地报名库").Find("(身份证号 = '" & r("身份证号") & "' Or 学籍号 = '" & r("学籍号") & "') and _Identify <> '" & r("_Identify") & "' and 考试名称 ='" & c7 &"'")
If dr4 IsNot Nothing Then
r("重复情况") = "与" & dr4("学校班级") & dr4("姓名") & "重复"
xcf = xcf+1
Else
r("重复情况") = "无重复"
End If
Next
For Each r As Row In Tables("中考报名_table4")
Dim dr4 As DataRow = DataTables("生地报名库").sqlFind("(身份证号 = '" & r("身份证号") & "' Or 学籍号 = '" & r("学籍号") & "') and _Identify <> '" & r("_Identify") & "' and 考试名称 ='" & c7 &"'")
If dr4 IsNot Nothing Then
r("重复情况") = "与" & dr4("学校班级") & dr4("姓名") & "重复"
xcf = xcf+1
Else
r("重复情况") = "无重复"
End If
Next
If xcf >0
messagebox.show("请注意重复报名记录:" & xcf & "条","提示")
End If
End If
p.value=0
End If
Else
messagebox.show("请选择勾选8年级和9年级在校学生","提示",MessageBoxButtons.OK)
End If
End If
End If
Tables("中考报名_table4").sort = "学校班级,备注"
请问老师一个奇怪问题:实际测试出有几个学生的身份证在生地报名库明有,但增加了记录,反复比对其身份证号是一样的?是什么原因