📄 addteacher.frm
字号:
VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form addTeacher
BorderStyle = 1 'Fixed Single
Caption = "添加教师信息"
ClientHeight = 5985
ClientLeft = 60
ClientTop = 345
ClientWidth = 9495
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5985
ScaleWidth = 9495
Begin MSACAL.Calendar Calendar2
Height = 2895
Left = 4320
TabIndex = 30
Top = 2880
Visible = 0 'False
Width = 4335
_Version = 524288
_ExtentX = 7646
_ExtentY = 5106
_StockProps = 1
BackColor = -2147483633
Year = 2003
Month = 6
Day = 13
DayLength = 0
MonthLength = 0
DayFontColor = 0
FirstDay = 1
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = -1 'True
ShowHorizontalGrid= -1 'True
ShowTitle = -1 'True
ShowVerticalGrid= -1 'True
TitleFontColor = 10485760
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSACAL.Calendar Calendar1
Height = 2895
Left = 120
TabIndex = 29
Top = 2880
Visible = 0 'False
Width = 4335
_Version = 524288
_ExtentX = 7646
_ExtentY = 5106
_StockProps = 1
BackColor = -2147483633
Year = 2003
Month = 6
Day = 13
DayLength = 0
MonthLength = 0
DayFontColor = 0
FirstDay = 1
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = -1 'True
ShowHorizontalGrid= -1 'True
ShowTitle = -1 'True
ShowVerticalGrid= -1 'True
TitleFontColor = 10485760
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.CommandButton Command2
Caption = "返回(&B)"
Height = 495
Left = 7440
TabIndex = 15
Top = 5280
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "保存(&S)"
Height = 495
Left = 4440
TabIndex = 14
Top = 5280
Width = 1335
End
Begin VB.Frame Frame1
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 9255
Begin RichTextLib.RichTextBox RichTextBox1
Height = 855
Left = 1680
TabIndex = 28
Top = 3720
Width = 7095
_ExtentX = 12515
_ExtentY = 1508
_Version = 393217
TextRTF = $"addTeacher.frx":0000
End
Begin VB.CommandButton Command4
Caption = ">"
Height = 375
Left = 7680
TabIndex = 17
Top = 2400
Width = 375
End
Begin VB.CommandButton Command3
Caption = ">"
Height = 375
Left = 3360
TabIndex = 16
Top = 2400
Width = 375
End
Begin VB.TextBox Text6
Height = 375
Left = 1680
TabIndex = 13
Top = 3000
Width = 7095
End
Begin VB.ComboBox Combo5
Height = 300
Left = 7560
TabIndex = 12
Top = 1800
Width = 1215
End
Begin VB.ComboBox Combo4
Height = 300
Left = 4680
TabIndex = 11
Top = 1800
Width = 1335
End
Begin VB.TextBox Text5
Height = 375
Left = 6120
TabIndex = 10
Top = 2400
Width = 1575
End
Begin VB.TextBox Text4
Height = 375
Left = 1680
TabIndex = 9
Top = 2400
Width = 1695
End
Begin VB.TextBox Text3
Height = 375
Left = 1680
TabIndex = 8
Top = 1800
Width = 1335
End
Begin VB.ComboBox Combo3
Height = 300
ItemData = "addTeacher.frx":009D
Left = 7560
List = "addTeacher.frx":00A7
TabIndex = 7
Top = 1200
Width = 1215
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "addTeacher.frx":00B7
Left = 4680
List = "addTeacher.frx":00C7
TabIndex = 6
Top = 1200
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "addTeacher.frx":00E5
Left = 1680
List = "addTeacher.frx":00EF
TabIndex = 5
Top = 1200
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
Left = 4680
TabIndex = 4
Top = 480
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Left = 1680
TabIndex = 2
Top = 480
Width = 1335
End
Begin VB.Label Label12
Caption = "备注信息:"
Height = 375
Left = 480
TabIndex = 27
Top = 3840
Width = 1215
End
Begin VB.Label Label11
Caption = "家庭住址:"
Height = 375
Left = 480
TabIndex = 26
Top = 3075
Width = 1095
End
Begin VB.Label Label10
Caption = "参加工作日期:"
Height = 375
Left = 4680
TabIndex = 25
Top = 2485
Width = 1335
End
Begin VB.Label Label9
Caption = "出生日期:"
Height = 495
Left = 480
TabIndex = 24
Top = 2485
Width = 1095
End
Begin VB.Label Label8
Caption = "籍贯:"
Height = 375
Left = 6360
TabIndex = 23
Top = 1830
Width = 975
End
Begin VB.Label Label7
Caption = "民族:"
Height = 255
Left = 3480
TabIndex = 22
Top = 1830
Width = 1095
End
Begin VB.Label Label6
Caption = "联系电话:"
Height = 375
Left = 480
TabIndex = 21
Top = 1870
Width = 975
End
Begin VB.Label Label5
Caption = "政治面目:"
Height = 375
Left = 6360
TabIndex = 20
Top = 1270
Width = 1095
End
Begin VB.Label Label4
Caption = "职称:"
Height = 375
Left = 3480
TabIndex = 19
Top = 1230
Width = 975
End
Begin VB.Label Label3
Caption = "性别:"
Height = 255
Left = 480
TabIndex = 18
Top = 1230
Width = 1095
End
Begin VB.Label Label2
Caption = "教师姓名:"
Height = 375
Left = 3480
TabIndex = 3
Top = 550
Width = 1095
End
Begin VB.Label Label1
Caption = "教师编号:"
Height = 375
Left = 480
TabIndex = 1
Top = 550
Width = 975
End
End
End
Attribute VB_Name = "addTeacher"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public DeptID As Integer
Private Sub Calendar1_Click()
Text4.Text = Calendar1.Value
Calendar1.Visible = False
End Sub
Private Sub Calendar2_Click()
Text5.Text = Calendar2.Value
Calendar2.Visible = False
End Sub
Private Sub Command1_Click()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
Dim insSQL As String
Dim InsText As String
Dim INS As ADODB.Recordset
Dim ID1, ID2 As Integer
If Not (Testtxt(Text1) And Testtxt(Text2) And Testtxt(Text3) And Testtxt(Text4) And Testtxt(Text5) And Testtxt(Text6) And Testtxt(Combo1) And Testtxt(Combo2) And Testtxt(Combo3) And Testtxt(Combo4) And Testtxt(Combo5)) Then
MsgBox "请填写完整教师信息!", vbOKOnly + vbExclamation, "学籍管理系统"
Exit Sub
End If
If Not IsDate(Text4) Then
MsgBox "日期的输入的格式为(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Text4.Text = ""
Exit Sub
End If
If Not IsDate(Text5) Then
MsgBox "日期的输入的格式为(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text5.SetFocus
Text5.Text = ""
Exit Sub
End If
txtSQL = "SELECT * FROM USERINFO WHERE Name='" & Text1.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If Not (MRC.EOF) Then
MsgBox "数据库中已经存在教师编号为[" & Text1.Text & "]的记录,请查证后重新填写!", vbOKOnly + vbExclamation, "学籍管理系统"
Text1.Text = ""
Exit Sub
End If
If (RichTextBox1.Text = "") Then
RichTextBox1.Text = " "
End If
txtSQL = "SELECT HomeTownID FROM HOMETOWN WHERE HomeTownName='" & Combo5.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
ID1 = MRC.Fields(0).Value
txtSQL = "SELECT NationalityID FROM NATIONALITY WHERE NationalityName='" & Combo4.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
ID2 = MRC.Fields(0).Value
insSQL = "INSERT INTO USERINFO VALUES('" & Text1.Text & "','" & Text2.Text & "','" & Combo1.Text & "','" & Text4.Text & "','" & Combo2.Text & "','" & Combo3.Text & "','" & Text5.Text & "'," & DeptID & ",'" & Text6.Text & "','" & Text3.Text & "'," & ID2 & "," & ID1 & ",'" & RichTextBox1.Text & "')"
Set MRC = ExecuteSQL(insSQL, InsText)
Call Module1.JUDGE(InsText, addTeacher)
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
RichTextBox1.Text = ""
End Sub
Private Sub Command2_Click()
Unload getDept
Unload Me
End Sub
Private Sub Command3_Click()
Calendar1.Visible = True
End Sub
Private Sub Command4_Click()
Calendar2.Visible = True
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
txtSQL = "SELECT DeptID FROM DEPARTMENT WHERE DeptName='" & getDept.Combo1.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
DeptID = MRC.Fields(0).Value
txtSQL = "SELECT NationalityName FROM NATIONALITY"
Call Module1.DataList(txtSQL, Combo4)
txtSQL = "SELECT HomeTownName FROM HOMETOWN"
Call Module1.DataList(txtSQL, Combo5)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -