📄 frmawardedit.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form frmAwardEdit
BorderStyle = 1 'Fixed Single
Caption = "获奖信息编辑"
ClientHeight = 4305
ClientLeft = 45
ClientTop = 330
ClientWidth = 9435
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4305
ScaleWidth = 9435
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc AdoName
Height = 375
Left = 120
Top = 3720
Visible = 0 'False
Width = 2415
_ExtentX = 4260
_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 = "AdoName"
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 MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1320
Top = 3480
Visible = 0 'False
Width = 2895
_ExtentX = 5106
_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= 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 btnCancel
Caption = "取消"
Height = 375
Left = 6840
TabIndex = 10
Top = 3600
Width = 1455
End
Begin VB.CommandButton btnSave
Caption = "保存"
Height = 375
Left = 4560
TabIndex = 9
Top = 3600
Width = 1575
End
Begin VB.Frame Frame1
Height = 3135
Left = 120
TabIndex = 0
Top = 120
Width = 9135
Begin VB.TextBox txtId
Height = 270
Left = 1560
TabIndex = 12
Top = 600
Width = 1935
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 2175
Left = 5160
TabIndex = 8
Top = 480
Width = 3615
_ExtentX = 6376
_ExtentY = 3836
_Version = 393217
TextRTF = $"frmAwardEdit.frx":0000
End
Begin VB.TextBox txtArea
Height = 270
Left = 1560
TabIndex = 6
Top = 2400
Width = 1935
End
Begin VB.TextBox txtTime
Height = 270
Left = 1560
TabIndex = 4
Top = 1800
Width = 1935
End
Begin VB.TextBox txtName
Height = 270
Left = 1560
TabIndex = 3
Top = 1200
Width = 1935
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "教师工号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 11
Top = 600
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "备注"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4200
TabIndex = 7
Top = 480
Width = 450
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "地点"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 720
TabIndex = 5
Top = 2400
Width = 450
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "时间"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 720
TabIndex = 2
Top = 1800
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "奖励名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 1
Top = 1200
Width = 900
End
End
End
Attribute VB_Name = "frmAwardEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public modify As Boolean
Private Sub btnCancel_Click()
Unload Me
End Sub
Private Sub btnSave_Click()
If Len(Trim(txtId.Text)) = 0 Then
MsgBox "教师身份证号不能为空!", vbExclamation
txtId.SetFocus
Exit Sub
End If
'判断身份证号是否存在
If MyTeacher.Teacher_In_DB(MakeStr(txtId.Text)) = False Then
MsgBox "该教师不存在,请重新输入!", vbExclamation
txtId.SetFocus
Exit Sub
End If
If Len(Trim(txtName.Text)) = 0 Then
MsgBox "获奖名称不能为空!", vbExclamation
txtName.SetFocus
Exit Sub
End If
If Len(Trim(txtTime.Text)) = 0 Then
MsgBox "获奖时间不能为空!", vbExclamation
txtTime.SetFocus
Exit Sub
End If
If IsDate(Trim(txtTime.Text)) = False Then
MsgBox "时间格式不正确!", vbExclamation
txtTime.SetFocus
Exit Sub
End If
If Len(Trim(txtArea.Text)) = 0 Then
MsgBox "获奖地点不能为空!", vbExclamation
txtArea.SetFocus
Exit Sub
End If
'给字段值赋值
With MyTeacher
.AwardName = MakeStr(txtName.Text)
.AwardTime = MakeStr(txtTime.Text)
.AwardArea = MakeStr(txtArea.Text)
.AwardMemo = MakeStr(RichTextBox1.Text)
.teacherid = MakeStr(txtId.Text)
End With
If modify = True Then
'修改教师获奖信息
MyTeacher.UpdateAward (CurTeacher.AwardId)
MsgBox "记录更新成功!", vbInformation
'刷新DataGrid中的数据
Call frmAward.Refresh_Datagrid
Unload Me
Else
'添加获奖信息
If MyTeacher.AwardExist = True Then
MyTeacher.InsertAward
MsgBox "记录添加成功!", vbInformation
Call frmAward.Refresh_Datagrid
Unload Me
Else
MsgBox "纪录已经存在!", vbExclamation
Exit Sub
End If
End If
End Sub
Private Sub Form_Load()
'AdoName.ConnectionString = conn
'AdoName.RecordSource = "select teacher_id,teacher_name from teacherInfo"
'AdoName.Refresh
'DataCombo1.ListField = "teacher_id"
'DataCombo1.BoundColumn = "teacher_id"
'Dim i
'i = DataCombo1.SelectedItem
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -