📄 addxf_w1.frm
字号:
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "addxf_w1.frx":3BBFC
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "addxf_w1.frx":3CA50
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "addxf_w1.frx":3F204
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "addxf_w1.frx":40058
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "addxf_w1.frx":40934
Key = ""
EndProperty
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请选择欲处理学生所在班级"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 120
TabIndex = 16
Top = 360
Width = 3375
End
End
End
Attribute VB_Name = "addxf_w1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bb1 As Boolean
Dim bb2 As Boolean
Dim stid As Integer
Dim gzid As Integer
Dim fens As Double
Dim fene As Double
Dim b As String
Private Sub Command1_Click()
On Error GoTo 1
gzid = Right(TreeView2.SelectedItem.Key, Len(TreeView2.SelectedItem.Key) - 1)
If Left(TreeView2.SelectedItem.Key, 1) <> "G" Then Exit Sub
Dim temp As New ADODB.Recordset
temp.Open "select * from [gz] where [ID]=" & gzid, main.connect, 3, 2
If temp.RecordCount <> 0 Then
Dim formtemp As New addxf_gzp
formtemp.Label4.Caption = temp.Fields(1)
If temp.Fields(2) = temp.Fields(3) Then
formtemp.Label3.Caption = temp.Fields(2) & "学分"
Else
formtemp.Label3.Caption = temp.Fields(2) & "学分~" & temp.Fields(3) & "学分"
End If
formtemp.Label6.Caption = temp.Fields(4)
formtemp.Show 1
End If
Exit Sub
1
MsgBox "请选择一规则,在察看它的信息", vbOKOnly Or vbInformation, "提示"
End Sub
Private Sub Command11_Click()
Unload Me
Dim formtemp As New addxf
formtemp.Show 1
Set formtemp = Nothing
End Sub
Private Sub Command3_Click()
If Frame2.Visible = True Then
If Left(TreeView1.SelectedItem.Key, 1) = "B" Then
ListView1.ListItems.Clear
Dim itmX As ListItem
Dim bb As New ADODB.Recordset
bb.Open "select * from [student] where [clasid]=" & Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1) & " order by [stid]", main.connect, 3, 2
If bb.RecordCount = 0 Then
MsgBox "这个班级没有注册学生" & Chr(13) & Chr(10) & "请您选择一个有注册学生的班级", vbOKOnly Or vbInformation, "提示"
bb.Close
Exit Sub
End If
For i = 1 To bb.RecordCount
Set itmX = ListView1.ListItems.Add(, "S" & bb.Fields(0), bb.Fields(3), 1, 1)
itmX.SubItems(1) = bb.Fields(1)
If bb.Fields(2) = True Then itmX.SubItems(2) = "男" Else itmX.SubItems(2) = "女"
If bb.Fields(4) = 0 Then itmX.SubItems(3) = "无"
If bb.Fields(4) = 1 Then itmX.SubItems(3) = "中国共青团员"
If bb.Fields(4) = 2 Then itmX.SubItems(3) = "中国共产党员"
bb.MoveNext
Next
bb.Close
Frame3.Visible = True
Frame2.Visible = False
ListView1.SetFocus
b = TreeView1.SelectedItem.Parent.Parent.Parent.Text & TreeView1.SelectedItem.Parent.Parent.Text & TreeView1.SelectedItem.Parent.Text & TreeView1.SelectedItem.Text
Label6.Caption = "第二步(共四步)"
Else
MsgBox "请您选择一个班级", vbInformation Or vbOKOnly, "提示"
End If
Exit Sub
End If
If Frame3.Visible = True Then
stid = Right(ListView1.SelectedItem.Key, Len(ListView1.SelectedItem.Key) - 1)
Label10 = b & "---" & ListView1.SelectedItem.SubItems(1)
Frame3.Visible = False
Frame4.Visible = True
Label6.Caption = "第三步(共四步)"
TreeView2.SetFocus
SendKeys "{RIGHT}"
Exit Sub
End If
If Frame4.Visible = True Then
If Left(TreeView2.SelectedItem.Key, 1) = "G" Then
ii = Right(TreeView2.SelectedItem.Key, Len(TreeView2.SelectedItem.Key) - 1)
Dim temp3 As New ADODB.Recordset
temp3.Open "select * from [gz] where [ID]=" & ii, main.connect, 3, 2
If temp3.RecordCount <> 0 Then
gzid = ii
fens = temp3.Fields(2) * 10
fene = temp3.Fields(3) * 10
temp3.Close
Frame1.Visible = True
Frame4.Visible = False
Text3.Text = fens / 10
Dim tempf As MSComctlLib.Node
Set tempf = TreeView2.SelectedItem
While Right(tempf.Key, Len(tempf.Key) - 1) <> 0
a = "[" & tempf.Text & "]" & a
Set tempf = tempf.Parent
Wend
Label7.Caption = a
Label6.Caption = "第四步(共四步)"
Exit Sub
End If
temp3.Close
Else
MsgBox "请您选择一规则", vbOKOnly Or vbInformation, "提示"
End If
Exit Sub
End If
If Frame1.Visible = True Then
If Text2.Text = "" Then Text2.Text = " "
Text2.Text = Replace(Text2.Text, "'", "‘")
main.connect.Execute "insert into [jc]([stid],[gzid],[dd],[xn],[jd],[bz]) values(" & stid & "," & gzid & ",'" & Now & "','" & Text1.Text & "'," & Text3.Text & ",'" & Text2.Text & "')"
If MsgBox("添加成功," & Chr(13) & Chr(10) & "是否还进行学分评测处理?", vbYesNo Or vbQuestion, "提示") <> vbYes Then
Unload Me
Exit Sub
End If
Exit Sub
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
If Frame2.Visible = True Then
Exit Sub
End If
If Frame3.Visible = True Then
Frame2.Visible = True
Frame3.Visible = False
Label6.Caption = "第一步(共四步)"
Exit Sub
End If
If Frame4.Visible = True Then
Frame3.Visible = True
Frame4.Visible = False
Label6.Caption = "第二步(共四步)"
Exit Sub
End If
If Frame1.Visible = True Then
Frame4.Visible = True
Frame1.Visible = False
Label6.Caption = "第三步(共四步)"
Exit Sub
End If
End Sub
Private Sub Form_Load()
yy = Year(Now)
If Month(Now) < 8 Then yy = yy - 1
Text1.Text = yy
yesno = False
Dim nodX As Node
Set nodX = TreeView1.Nodes.Add(, , "R", "西安科技学院", 1)
Dim xu As New ADODB.Recordset
Dim zy As New ADODB.Recordset
Dim nj As New ADODB.Recordset
Dim ban As New ADODB.Recordset
xu.Open "select * from [xb]", main.connect, 3, 2
For i = 1 To xu.RecordCount
Set nodX = TreeView1.Nodes.Add("R", tvwChild, "X" & xu.Fields(0), xu.Fields(1) & "系", 2)
zy.Open "select * from [zy] where [xid]=" & xu.Fields(0), main.connect, 3, 2
For i1 = 1 To zy.RecordCount
Set nodX = TreeView1.Nodes.Add("X" & xu.Fields(0), tvwChild, "Z" & zy.Fields(0), zy.Fields(1) & "专业", 3)
nj.Open "select * from [yc] where [zyid]=" & zy.Fields(0), main.connect, 3, 2
For i2 = 1 To nj.RecordCount
Set nodX = TreeView1.Nodes.Add("Z" & zy.Fields(0), tvwChild, "N" & nj.Fields(0), nj.Fields(1) & "级", 4)
ban.Open "select * from [class] where [yid]=" & nj.Fields(0), main.connect, 3, 2
For i3 = 1 To ban.RecordCount
Set nodX = TreeView1.Nodes.Add("N" & nj.Fields(0), tvwChild, "B" & ban.Fields(0), ban.Fields(1) & "班", 5)
ban.MoveNext
Next
ban.Close
nj.MoveNext
Next
nj.Close
zy.MoveNext
Next
zy.Close
xu.MoveNext
Next
TreeView2.Nodes.Clear
Dim temp1 As New ADODB.Recordset
temp1.Open "select * from [gz] where [xn]='" & Text1.Text & "'", main.connect, 3, 2
' Dim nodX As Node
Set nodX = TreeView2.Nodes.Add(, , "R0", "西安科技学院学分评测制度", 2)
For i = 1 To temp1.RecordCount
If temp1.Fields(7) = True Then
Set nodX = TreeView2.Nodes.Add("R" & temp1.Fields(5), tvwChild, "R" & temp1.Fields(0), temp1.Fields(1), 2)
Else
Set nodX = TreeView2.Nodes.Add("R" & temp1.Fields(5), tvwChild, "G" & temp1.Fields(0), temp1.Fields(1), 1)
End If
temp1.MoveNext
Next
temp1.Close
SendKeys "{RIGHT}"
Label2.Caption = "-" & Text1.Text + 1 & "学年"
End Sub
Private Sub ListView1_DblClick()
Command3_Click
End Sub
Private Sub Text1_Change()
TreeView2.Nodes.Clear
Dim temp1 As New ADODB.Recordset
temp1.Open "select * from [gz] where [xn]='" & Text1.Text & "' order by [ID]", main.connect, 3, 2
' Dim nodX As Node
Set nodX = TreeView2.Nodes.Add(, , "R0", "西安科技学院学分评测制度", 2)
For i = 1 To temp1.RecordCount
If temp1.Fields(7) = True Then
Set nodX = TreeView2.Nodes.Add("R" & temp1.Fields(5), tvwChild, "R" & temp1.Fields(0), temp1.Fields(1), 2)
Else
Set nodX = TreeView2.Nodes.Add("R" & temp1.Fields(5), tvwChild, "G" & temp1.Fields(0), temp1.Fields(1), 1)
End If
temp1.MoveNext
Next
temp1.Close
On Error GoTo 1
TreeView2.Refresh
TreeView2.SetFocus
Label2.Caption = "-" & Text1.Text + 1 & "学年"
1
SendKeys "{RIGHT}"
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then Call UpDown2_UpClick
If KeyCode = 40 Then Call UpDown2_DownClick
KeyCode = 0
Shift = 0
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub TreeView1_DblClick()
If Left(TreeView1.SelectedItem.Key, 1) = "B" Then Command3_Click
End Sub
Private Sub TreeView2_DblClick()
If Left(TreeView2.SelectedItem.Key, 1) = "G" Then Command3_Click
End Sub
Private Sub UpDown2_DownClick()
If Text3.Text * 10 > fens Then Text3.Text = Text3.Text - 0.1
End Sub
Private Sub UpDown2_UpClick()
If Text3.Text * 10 < fene Then Text3.Text = Text3.Text + 0.1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -