📄 addxf.frm
字号:
Top = 855
Width = 1335
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "学分评测"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Index = 0
Left = 120
TabIndex = 4
Top = 840
Width = 1335
End
Begin VB.Image Image1
Height = 720
Left = 120
Picture = "addxf.frx":4F345
Stretch = -1 'True
Top = 120
Width = 720
End
Begin VB.Shape Shape1
BorderColor = &H000000FF&
BorderWidth = 2
Height = 15
Left = 120
Top = 1200
Width = 1335
End
Begin VB.Shape Shape2
BorderColor = &H0000FF00&
BorderWidth = 2
Height = 15
Left = 120
Top = 1245
Width = 1215
End
End
End
Attribute VB_Name = "addxf"
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
Private Sub Command1_Click()
Frame1.Enabled = False
Frame3.Visible = True
End Sub
Private Sub Command10_Click()
'On Error GoTo 1
bb1 = True
stid = Right(ListView1.SelectedItem.Key, Len(ListView1.SelectedItem.Key) - 1)
Label3.Caption = Label10.Caption & "----" & ListView1.SelectedItem.SubItems(1)
Call Command9_Click
If bb1 = True And bb2 = True Then
UpDown2.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Command3.Enabled = True
End If
kk stid
Exit Sub
1
MsgBox "您还没有选择学生。", vbOKOnly Or vbInformation, "提示"
End Sub
Private Sub Command11_Click()
Unload Me
Dim formtemp As New addxf_w1
formtemp.Show 1
End Sub
Private Sub Command12_Click()
If Me.Width = 11700 Then
Me.Width = 6780
Command12.Caption = ">>"
Else
Command12.Caption = "<<"
Me.Width = 11700
End If
End Sub
Private Sub Command2_Click()
If TreeView1.Nodes.Count = 1 Then
MsgBox "此学年学分评测规定还未导入系统", vbOKOnly Or vbInformation, "提示"
Exit Sub
End If
Frame1.Enabled = False
Frame2.Visible = True
TreeView1.SetFocus
SendKeys "{RIGHT}"
End Sub
Private Sub Command3_Click()
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
Text2.Text = ""
kk stid
Command1.SetFocus
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
On Error GoTo 1
gzid = Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1)
If Left(TreeView1.SelectedItem.Key, 1) <> "G" Then GoTo 1
bb2 = True
Dim temp As MSComctlLib.Node
Set temp = TreeView1.SelectedItem
While Right(temp.Key, Len(temp.Key) - 1) <> 0
a = "[" & temp.Text & "]" & a
Set temp = temp.Parent
Wend
Label6.Caption = a
Call Command6_Click
If bb1 = True And bb2 = True Then
UpDown2.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Command3.Enabled = True
End If
Dim recordtemp As New ADODB.Recordset
recordtemp.Open "select * from [gz] where [ID]=" & gzid, main.connect, 3, 2
If recordtemp.RecordCount <> 0 Then
fens = recordtemp.Fields(2) * 10
fene = recordtemp.Fields(3) * 10
End If
Text3.Text = fens / 10
UpDown1.Enabled = False
Text1.Enabled = False
Exit Sub
1
MsgBox "请选择一规则", vbOKOnly Or vbInformation, "提示"
End Sub
Private Sub Command6_Click()
Frame1.Enabled = True
Frame2.Visible = False
End Sub
Private Sub Command7_Click()
On Error GoTo 1
gzid = Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1)
If Left(TreeView1.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 Command8_Click()
Dim temp As New selectclass
temp.Label1.Visible = False
temp.Show 1
If temp.yesno = False Then Exit Sub
Label10.Caption = temp.nn
id = temp.kk
Set temp = Nothing
ListView1.ListItems.Clear
Dim itmX As ListItem
Dim bb As New ADODB.Recordset
bb.Open "select * from [student] where [clasid]=" & id & " order by [stid]", main.connect, 3, 2
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
End Sub
Private Sub Command9_Click()
Frame1.Enabled = True
Frame3.Visible = False
End Sub
Private Sub Form_Load()
yy = Year(Now)
If Month(Now) < 8 Then yy = yy - 1
Text1.Text = yy
bb1 = False
bb2 = False
TreeView1.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 = TreeView1.Nodes.Add(, , "R0", "西安科技学院学分评测制度", 2)
For i = 1 To temp1.RecordCount
If temp1.Fields(7) = True Then
Set nodX = TreeView1.Nodes.Add("R" & temp1.Fields(5), tvwChild, "R" & temp1.Fields(0), temp1.Fields(1), 2)
Else
Set nodX = TreeView1.Nodes.Add("R" & temp1.Fields(5), tvwChild, "G" & temp1.Fields(0), temp1.Fields(1), 1)
End If
temp1.MoveNext
Next
temp1.Close
SendKeys "{RIGHT}"
End Sub
Private Sub ListView1_DblClick()
Command10_Click
End Sub
Private Sub Text1_Change()
TreeView1.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 = TreeView1.Nodes.Add(, , "R0", "西安科技学院学分评测制度", 2)
For i = 1 To temp1.RecordCount
If temp1.Fields(7) = True Then
Set nodX = TreeView1.Nodes.Add("R" & temp1.Fields(5), tvwChild, "R" & temp1.Fields(0), temp1.Fields(1), 2)
Else
Set nodX = TreeView1.Nodes.Add("R" & temp1.Fields(5), tvwChild, "G" & temp1.Fields(0), temp1.Fields(1), 1)
End If
temp1.MoveNext
Next
temp1.Close
Label1.Caption = "-" & Text1.Text + 1 & "学年"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 And Text1.Text < 2999 Then Text1.Text = Text1.Text + 1
If KeyCode = 40 And Text1.Text > 2001 Then Text1.Text = Text1.Text - 1
KeyCode = 0
Shift = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text2_DblClick()
Call Command7_Click
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()
On Error GoTo 1
gzid = Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1)
If Left(TreeView1.SelectedItem.Key, 1) <> "G" Then GoTo 1
Command5_Click
1
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
Private Sub TreeView2_DblClick()
Call Command7_Click
End Sub
Sub kk(id)
'On Error GoTo 1
Label11.Caption = ListView1.SelectedItem.Text
Label13.Caption = ListView1.SelectedItem.SubItems(1)
id = Right(ListView1.SelectedItem.Key, Len(ListView1.SelectedItem.Key) - 1)
Dim temp As New ADODB.Recordset
Dim temp2 As New ADODB.Recordset
Dim itmX As ListItem
temp.Open " select * from [jc] where [stid]=" & id & " order by [xn]", main.connect, 3, 2
ListView2.ListItems.Clear
For i = 1 To temp.RecordCount
b = ""
temp2.Open "select * from [gz] ", main.connect, 3, 2
temp2.Find "ID = " & temp.Fields(2), 0, adSearchForward, 1
While (Not (temp2.EOF))
b = "[" & temp2.Fields(1) & "]" & b
idf = temp2.Fields(5)
temp2.Find "ID = " & idf, 0, adSearchForward, 1
Wend
temp2.Close
Set itmX = ListView2.ListItems.Add(, "S" & temp.Fields(0), b, 2, 2)
itmX.SubItems(1) = temp.Fields(4) & "-" & temp.Fields(4) + 1
itmX.SubItems(2) = temp.Fields(3)
itmX.SubItems(3) = temp.Fields(5)
temp2.Open "select * from [gz] where [ID]=" & temp.Fields(2), main.connect, 3, 2
If temp2.RecordCount <> 0 Then
itmX.SubItems(4) = temp2.Fields(4)
itmX.SubItems(5) = temp2.Fields(4) * temp.Fields(5)
End If
temp2.Close
temp.MoveNext
Next
temp.Close
1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -