?? 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 "請輸入數(shù)字編號!", 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 "課程已經(jīng)存在,請重新輸入課程號!", 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 + -