📄 frmaward.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 frmAward
Caption = "教师获奖情况"
ClientHeight = 6810
ClientLeft = 60
ClientTop = 345
ClientWidth = 10350
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 6810
ScaleWidth = 10350
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 6000
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 661
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= 1
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.CommandButton btnBack
Caption = "返回"
Height = 375
Left = 7560
TabIndex = 9
Top = 6120
Width = 1095
End
Begin VB.CommandButton btnDel
Caption = "删除"
Height = 375
Left = 6000
TabIndex = 8
Top = 6120
Width = 1095
End
Begin VB.CommandButton btnModi
Caption = "修改"
Height = 375
Left = 4560
TabIndex = 7
Top = 6120
Width = 1095
End
Begin VB.CommandButton btnAdd
Caption = "添加"
Height = 375
Left = 3000
TabIndex = 6
Top = 6120
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmAward.frx":0000
Height = 4335
Left = 120
TabIndex = 4
Top = 1440
Width = 10095
_ExtentX = 17806
_ExtentY = 7646
_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 VB.TextBox txtIdendity
Height = 375
Left = 1560
TabIndex = 1
Top = 600
Width = 2415
End
Begin VB.TextBox txtName
Height = 375
Left = 5520
TabIndex = 0
Top = 600
Width = 2415
End
Begin VB.Frame Frame1
Caption = "查询条件"
Height = 1215
Left = 120
TabIndex = 2
Top = 120
Width = 10095
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "教师姓名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 4200
TabIndex = 5
Top = 600
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "教师工号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 360
TabIndex = 3
Top = 600
Width = 900
End
End
End
Attribute VB_Name = "frmAward"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
End Sub
Private Sub btnAdd_Click()
frmAwardEdit.modify = False
frmAwardEdit.Show 1
End Sub
Private Sub btnBack_Click()
Unload Me
End Sub
Private Sub btnDel_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录!", vbExclamation
Exit Sub
End If
If MsgBox("确认要删除记录?", vbQuestion + vbYesNo) = vbNo Then
Exit Sub
Else
End If
'删除记录
MyTeacher.DeleteAward (Adodc1.Recordset.Fields(0))
'刷新datagrid
MsgBox "删除记录成功!", vbInformation
Call Refresh_Datagrid
End Sub
Private Sub btnModi_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录!", vbExclamation
Exit Sub
End If
frmAwardEdit.modify = True
With frmAwardEdit
CurTeacher.AwardId = Adodc1.Recordset.Fields(0)
.txtId.Text = Adodc1.Recordset.Fields(2)
.txtName.Text = Adodc1.Recordset.Fields(4)
.txtTime.Text = Adodc1.Recordset.Fields(5)
.txtArea.Text = Adodc1.Recordset.Fields(6)
.RichTextBox1 = Adodc1.Recordset.Fields(7) & ""
End With
frmAwardEdit.Show 1
End Sub
Friend Sub Refresh_Datagrid()
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select a.AwardId,b.teacher_id,b.teacher_Idendity as 教师工号,b.teacher_name as 教师姓名,a.AwardName as 奖励名称," + _
"a.AwardTime as 获奖时间,a.AwardPlace as 获奖地点,a.AwardMemo as 备注" _
+ " from Award a,teacherInfo b where a.teacher_Idendity=b.teacher_Idendity and " + _
"b.teacher_Idendity like '%" + MakeStr(Trim(txtIdendity.Text)) + "%'" + _
"and b.teacher_name like '%" + MakeStr(Trim(txtName.Text)) + "%'"
Adodc1.Refresh
With DataGrid1
.Columns(0).Width = 0
.Columns(1).Width = 0
.Columns(2).Width = 2000
.Columns(3).Width = 2000
.Columns(4).Width = 2000
.Columns(5).Width = 2000
.Columns(6).Width = 2000
.Columns(7).Width = 2000
End With
End Sub
Private Sub Form_Load()
Call Refresh_Datagrid
End Sub
Private Sub txtIdendity_Change()
Call Refresh_Datagrid
End Sub
Private Sub txtName_Change()
Call Refresh_Datagrid
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -