📄 frmevaman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmEvaMan
BorderStyle = 1 'Fixed Single
Caption = "学生奖惩信息管理"
ClientHeight = 4830
ClientLeft = 45
ClientTop = 330
ClientWidth = 7710
ControlBox = 0 'False
Icon = "FrmEvaMan.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4830
ScaleWidth = 7710
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox ComboY
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 0
Top = 240
Width = 1095
End
Begin VB.ComboBox ComboType
Height = 300
ItemData = "FrmEvaMan.frx":0CCA
Left = 4920
List = "FrmEvaMan.frx":0CD4
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 1815
End
Begin VB.CommandButton Cmd_Back
BackColor = &H80000004&
Cancel = -1 'True
Caption = "返 回"
Height = 400
Left = 5880
MouseIcon = "FrmEvaMan.frx":0CE4
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 3960
Width = 1300
End
Begin VB.CommandButton Cmd_Del
BackColor = &H80000004&
Caption = "删 除"
Height = 400
Left = 4440
MouseIcon = "FrmEvaMan.frx":0FEE
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 3960
Width = 1300
End
Begin VB.CommandButton Cmd_Modi
BackColor = &H80000004&
Caption = "修 改"
Height = 400
Left = 2957
MouseIcon = "FrmEvaMan.frx":12F8
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 3960
Width = 1300
End
Begin VB.CommandButton Cmd_Add
BackColor = &H80000004&
Caption = "添 加"
Default = -1 'True
Height = 400
Left = 1440
MouseIcon = "FrmEvaMan.frx":1602
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 3960
Width = 1300
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmEvaMan.frx":190C
Height = 3135
Left = 240
TabIndex = 2
Top = 660
Width = 7335
_ExtentX = 12938
_ExtentY = 5530
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 3960
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "选择年份"
Height = 180
Left = 360
TabIndex = 8
Top = 300
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "选择类型"
Height = 180
Left = 3960
TabIndex = 7
Top = 300
Width = 720
End
End
Attribute VB_Name = "FrmEvaMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Eva()
'设置数据源
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "SELECT e.EvaId As 编号, e.EvaDate As 日期," _
+ " s.Student_Id as 学生编号, s.Student_Name as 学生姓名," _
+ " e.Memo as 具体说明 FROM Students s, Evaluation e" _
+ " WHERE e.EvaDate LIKE '" + ComboY.Text + "%' And e.EvaType=" _
+ Trim(ComboType.ListIndex) + " And e.Student_Id=s.Student_Id"
Adodc1.Refresh
End Sub
Private Sub Cmd_Add_Click()
FrmEvaEdit.txtEvaDate.Text = Format(Now, "yyyy-mm-dd")
SelStu.Init
FrmEvaEdit.ComboName.Text = ""
FrmEvaEdit.ComboType.ListIndex = ComboType.ListIndex
FrmEvaEdit.txtMemo = ""
FrmEvaEdit.Modify = False
FrmEvaEdit.Show 1
Refresh_Eva
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub Cmd_Del_Click()
Dim TmpId As Long
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
TmpId = Adodc1.Recordset.Fields(0)
If MsgBox("是否删除当前行?", vbYesNo, "确认") = vbYes Then
Call MyEva.DeleteById(TmpId)
End If
Refresh_Eva
End Sub
Private Sub Cmd_Modi_Click()
'初始化frmevaedit信息
FrmEvaEdit.OriId = Adodc1.Recordset.Fields(0)
FrmEvaEdit.txtEvaDate.Text = Trim(Adodc1.Recordset.Fields(1))
SelStu.Student_Id = Adodc1.Recordset.Fields(2)
SelStu.GetInfo (SelStu.Student_Id)
FrmEvaEdit.ComboName.Text = Trim(Adodc1.Recordset.Fields(3))
FrmEvaEdit.ComboType.Text = ComboType.Text
FrmEvaEdit.txtMemo = Trim(Adodc1.Recordset.Fields(4))
FrmEvaEdit.Modify = True
FrmEvaEdit.Show 1
Refresh_Eva
End Sub
Private Sub ComboType_Click()
Refresh_Eva
End Sub
Private Sub ComboY_Click()
Refresh_Eva
End Sub
Private Sub Form_Load()
'保存当前年份的临时变量
Dim yy As Integer
'将1900~2100的数字添加到“选择年份”列表框中
For i = 1900 To 2100
ComboY.AddItem Trim(Str(i))
Next
'将“选择年份”列表框中设置为当前的年份
yy = Year(Now)
If yy > 1899 And yy < 2101 Then
ComboY.Text = Trim(Str(yy))
End If
'设置“选择类型”列表框设置为“奖励”
ComboType.ListIndex = 0
'刷新DataGrid1表格的内容
Refresh_Eva
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -