www.pudn.com > new xsc.rar > frm1.frm
VERSION 5.00
Begin VB.Form frm1
Caption = "班主任学期考核"
ClientHeight = 6285
ClientLeft = 60
ClientTop = 345
ClientWidth = 8460
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 6285
ScaleWidth = 8460
Begin VB.Frame Frame2
Caption = "考核信息"
Height = 3735
Left = 0
TabIndex = 12
Top = 1680
Width = 8295
Begin VB.TextBox Text4
Height = 375
Left = 6600
TabIndex = 36
Top = 3030
Width = 1335
End
Begin VB.TextBox Text11
Height = 375
Left = 6600
TabIndex = 34
Top = 2520
Width = 1335
End
Begin VB.TextBox Text10
Height = 375
Left = 6600
TabIndex = 33
Top = 1980
Width = 1335
End
Begin VB.TextBox Text9
Height = 375
Left = 6600
TabIndex = 32
Top = 1440
Width = 1335
End
Begin VB.TextBox Text8
Height = 375
Left = 6600
TabIndex = 31
Top = 960
Width = 1335
End
Begin VB.TextBox Text7
Height = 375
Left = 6600
TabIndex = 30
Top = 480
Width = 1335
End
Begin VB.TextBox Text13
Height = 390
Left = 1800
TabIndex = 24
Top = 3015
Width = 1380
End
Begin VB.TextBox Text12
Height = 375
Left = 1800
TabIndex = 23
Top = 2520
Width = 1335
End
Begin VB.TextBox Text6
Height = 375
Left = 1800
TabIndex = 20
Top = 1980
Width = 1335
End
Begin VB.TextBox Text5
Height = 375
Left = 1800
TabIndex = 18
Top = 1440
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
Left = 1800
TabIndex = 14
Top = 480
Width = 1335
End
Begin VB.TextBox Text3
Height = 375
Left = 1800
TabIndex = 13
Top = 960
Width = 1335
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "津贴共计"
Height = 180
Left = 4560
TabIndex = 35
Top = 3120
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "文明寝室评比(次)"
Height = 180
Index = 6
Left = 4560
TabIndex = 29
Top = 2610
Width = 1440
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "教室规范化评比(次)"
Height = 180
Index = 5
Left = 4560
TabIndex = 28
Top = 2070
Width = 1620
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "上交材料(次)"
Height = 180
Index = 3
Left = 4560
TabIndex = 27
Top = 1537
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "参加班会(次)"
Height = 180
Index = 2
Left = 4560
TabIndex = 26
Top = 1057
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "参加班主任例会(次)"
Height = 180
Index = 1
Left = 4560
TabIndex = 25
Top = 577
Width = 1620
End
Begin VB.Label Label9
Caption = "指导参加“成才杯”活动"
Height = 420
Left = 360
TabIndex = 22
Top = 3000
Width = 1185
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "重大事故(次)"
Height = 180
Index = 4
Left = 360
TabIndex = 21
Top = 2610
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "集体通报(次)"
Height = 180
Index = 0
Left = 360
TabIndex = 19
Top = 2070
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "班级扣分"
Height = 180
Left = 360
TabIndex = 17
Top = 570
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "通报批评(次)"
Height = 180
Left = 360
TabIndex = 16
Top = 1057
Width = 1080
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "寝室到位(次)"
Height = 180
Left = 360
TabIndex = 15
Top = 1537
Width = 1260
End
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1680
TabIndex = 11
Top = 5640
Width = 2175
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 4560
TabIndex = 10
Top = 5640
Width = 2415
End
Begin VB.Frame Frame1
Caption = "班主任基本信息"
Height = 1455
Left = 0
TabIndex = 5
Top = 0
Width = 4335
Begin VB.TextBox Text1
Height = 375
Left = 1680
TabIndex = 7
Top = 960
Width = 1815
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1680
TabIndex = 6
Text = "请选择"
Top = 360
Width = 1815
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 9
Top = 960
Width = 855
End
Begin VB.Label Label1
Caption = "班级"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 8
Top = 360
Width = 735
End
End
Begin VB.Frame Frame10
Caption = "考核学期"
Height = 1455
Left = 4560
TabIndex = 0
Top = 0
Width = 3735
Begin VB.ComboBox Combo2
Height = 300
Index = 1
ItemData = "frm1.frx":0000
Left = 120
List = "frm1.frx":0010
TabIndex = 38
Top = 960
Width = 1335
End
Begin VB.ComboBox Combo3
Height = 300
Index = 1
ItemData = "frm1.frx":002C
Left = 2040
List = "frm1.frx":0054
TabIndex = 37
Top = 960
Width = 1095
End
Begin VB.ComboBox Combo2
Height = 300
Index = 0
ItemData = "frm1.frx":007F
Left = 120
List = "frm1.frx":008F
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.ComboBox Combo3
Height = 300
Index = 0
ItemData = "frm1.frx":00AB
Left = 2040
List = "frm1.frx":00D3
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "-----------起止日期-----------"
ForeColor = &H0080FF80&
Height = 180
Left = 360
TabIndex = 41
Top = 720
Width = 2700
End
Begin VB.Label Label5
Caption = "年"
Height = 375
Index = 1
Left = 1560
TabIndex = 40
Top = 960
Width = 495
End
Begin VB.Label Label6
Caption = "月"
Height = 255
Index = 1
Left = 3240
TabIndex = 39
Top = 960
Width = 375
End
Begin VB.Label Label5
Caption = "年"
Height = 375
Index = 0
Left = 1560
TabIndex = 4
Top = 360
Width = 495
End
Begin VB.Label Label6
Caption = "月"
Height = 255
Index = 0
Left = 3240
TabIndex = 3
Top = 360
Width = 375
End
End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim intcount, a, b, c, d, e, f As Integer
Dim smg, smg1 As String
Dim mr As ADODB.Recordset
Dim msgtext As String
a = 0
b = 0
c = 0
d = 0
e = 0
f = 0
If Trim(Combo1 & "") = "请选择" Then
MsgBox "请选择班级", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(0) & "") = "" Then
MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo3(0) & "") = "" Then
MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(1) & "") = "" Then
MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo3(1) & "") = "" Then
MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
smg = Format(CDate(Combo2(0) & "-" & Combo3(0) & "-" & "1"), "yyyy-mm-dd")
smg1 = Format(CDate(Combo2(1) & "-" & Combo3(1) & "-" & "1"), "yyyy-mm-dd")
If smg1 <= smg Then
MsgBox "错误,结束日期晚于起始日期!请检查学期的日期是否输入正确", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
txtSQL = "select sum(koufen),sum(lihui),sum(banhui),sum(tongbao),sum(qinshi) from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
If Not mr.EOF Then
Text2.Text = mr.Fields(0)
Text7.Text = mr.Fields(1)
Text8.Text = mr.Fields(2)
Text3.Text = mr.Fields(3)
Text5.Text = mr.Fields(4)
Else: MsgBox "未找到符合条件的纪录", vbOKCancel + vbExclamation, "警告"
End If
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and jititongbao=1"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
a = a + 1
mr.MoveNext
Loop
Text6.Text = a
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and cailiao=0"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
b = b + 1
mr.MoveNext
Loop
Text9.Text = b
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and huodong=0"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
c = c + 1
mr.MoveNext
Loop
Text13.Text = c
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and shigu=1"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
d = d + 1
mr.MoveNext
Loop
Text12.Text = d
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and jiaoshiguifanhua=1"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
e = e + 1
mr.MoveNext
Loop
Text10.Text = e
txtSQL = "select * from kaohe where class='" & Combo1 & "' and yuefen<='" & smg1 & "' and yuefen>='" & smg & "' and wenmingqinshi=1"
Set mr = ExecuteSQL(txtSQL, msgtext)
Do While Not mr.EOF
f = f + 1
mr.MoveNext
Loop
Text11.Text = f
txtSQL = "select sum(heji) from jintie where class='" & Combo1 & "' and riqi<='" & smg1 & "' and riqi>='" & smg & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
If Not mr.EOF Then
Text4.Text = mr.Fields(0)
Else: MsgBox "未找到符合条件的纪录", vbOKCancel + vbExclamation, "警告"
End If
txtSQL = "delete from banzhurenxueqi where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
txtSQL = "execute xueqi1setup'"
txtSQL = txtSQL & Trim(Combo1) & "','"
txtSQL = txtSQL & Trim(Text1.Text) & "','"
txtSQL = txtSQL & smg & "','"
txtSQL = txtSQL & smg1 & "','"
txtSQL = txtSQL & Trim(Text2.Text) & "','"
txtSQL = txtSQL & Trim(Text8.Text) & "','"
txtSQL = txtSQL & Trim(Text7.Text) & "','"
txtSQL = txtSQL & Trim(Text3.Text) & "','"
txtSQL = txtSQL & Trim(Text6.Text) & "','"
txtSQL = txtSQL & Trim(Text13.Text) & "','"
txtSQL = txtSQL & Trim(Text12.Text) & "','"
txtSQL = txtSQL & Trim(Text9.Text) & "','"
txtSQL = txtSQL & Trim(Text5.Text) & "','"
txtSQL = txtSQL & Trim(Text10.Text) & "','"
txtSQL = txtSQL & Trim(Text11.Text) & "','"
txtSQL = txtSQL & Trim(Text4.Text) & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
MsgBox "添加纪录成功!", vbOKOnly + vbExclamation, "添加纪录"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Height = 6690
Me.Width = 8580
Dim mrccc1 As ADODB.Recordset
Dim msgtext1 As String
Dim txtSQL As String
' Combo1.Clear
txtSQL = "select class from teacher"
Set mrccc1 = ExecuteSQL(txtSQL, msgtext1)
Do While Not mrccc1.EOF
Combo1.AddItem mrccc1.Fields(0)
mrccc1.MoveNext
Loop
mrccc1.Close
End Sub
Private Sub Combo1_Click()
Dim mrccc As ADODB.Recordset
Dim msgtext As String
Dim txtSQL As String
' Combo1.Clear
txtSQL = "select name1 from teacher where class='" & Combo1 & "'"
Set mrccc = ExecuteSQL(txtSQL, msgtext)
Text1.Text = mrccc.Fields(0)
mrccc.MoveNext
mrccc.Close
End Sub