📄 frmcourseinfo.frm
字号:
VERSION 5.00
Begin VB.Form frmAddcourseinfo
Caption = "添加课程信息"
ClientHeight = 3615
ClientLeft = 45
ClientTop = 345
ClientWidth = 7350
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 3615
ScaleWidth = 7350
Begin VB.ComboBox comboCoursetype
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 312
Left = 1560
TabIndex = 9
Top = 1200
Width = 1332
End
Begin VB.CommandButton Command2
Caption = "取消添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3840
TabIndex = 8
Top = 2760
Width = 1452
End
Begin VB.CommandButton Command1
Caption = "确认添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1320
TabIndex = 7
Top = 2760
Width = 1452
End
Begin VB.TextBox txtCoursedes
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1452
Left = 4680
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 1080
Width = 2412
End
Begin VB.TextBox txtCoursename
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4680
TabIndex = 3
Top = 240
Width = 1332
End
Begin VB.TextBox txtCourseno
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1560
TabIndex = 1
Top = 240
Width = 1332
End
Begin VB.Label Label4
Caption = "课程描述:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 5
Top = 1200
Width = 1212
End
Begin VB.Label Label3
Caption = "课程类型:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 4
Top = 1200
Width = 1212
End
Begin VB.Label Label2
Caption = "课程名称:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3360
TabIndex = 2
Top = 360
Width = 1212
End
Begin VB.Label Label1
Caption = "课程编号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 0
Top = 360
Width = 1212
End
End
Attribute VB_Name = "frmAddcourseinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim tmp_course As course
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtCourseno.Text) Then
MsgBox "请输入课程编号!", vbOKOnly + vbExclamation, "警告"
txtCourseno.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursename.Text) Then
MsgBox "请输入课程名称!", vbOKOnly + vbExclamation, "警告"
txtCoursename.SetFocus
Exit Sub
End If
If Not Testtxt(comboCoursetype.Text) Then
MsgBox "请选择课程类型!", vbOKOnly + vbExclamation, "警告"
comboCoursetype.SetFocus
Exit Sub
End If
If Not Testtxt(txtCoursedes.Text) Then
MsgBox "请输入课程描述信息!", vbOKOnly + vbExclamation, "警告"
txtCoursedes.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtCourseno.Text)) Then
MsgBox "请输入数字编号!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtCourseno.SetFocus
End If
Set tmp_course = New course
tmp_course.course_no = Trim(txtCourseno.Text)
tmp_course.query
If tmp_course.State = 1 Then 'exist duplicated course_no
If (Trim(tmp_course.course_no) = Trim(txtCourseno.Text)) Then
MsgBox "课程已经存在,请重新输入课程号!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtCourseno.Text = ""
txtCourseno.SetFocus
End If
End If
If tmp_course.State = 2 Then 'unexisted duplicated course_no
tmp_course.course_no = Trim(txtCourseno.Text)
tmp_course.course_name = Trim(txtCoursename.Text)
tmp_course.course_type = Trim(comboCoursetype.Text)
tmp_course.course_des = Trim(txtCoursedes.Text)
tmp_course.insert
End If
If InStr(tmp_course.oper_flag, "insert_ok") > 0 Then
MsgBox "添加班级信息成功!", vbOKOnly + vbExclamation, "添加班级信息"
Else
MsgBox "添加班级信息失败!", vbOKOnly + vbExclamation, "添加班级信息"
End If
txtCourseno.Text = ""
txtCoursename.Text = ""
txtCourseno.SetFocus
Set tmp_course = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
comboCoursetype.AddItem "必修"
comboCoursetype.AddItem "考查"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -