?? frmaddclassinfo.frm
字號:
VERSION 5.00
Begin VB.Form frmAddclassinfo
Caption = "添加班級信息"
ClientHeight = 2610
ClientLeft = 45
ClientTop = 345
ClientWidth = 5805
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 2610
ScaleWidth = 5805
Begin VB.ComboBox comboGrade
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 312
Left = 3720
TabIndex = 9
Top = 480
Width = 1692
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 = 372
Left = 2760
TabIndex = 8
Top = 1920
Width = 1092
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 = 372
Left = 960
TabIndex = 7
Top = 1920
Width = 1092
End
Begin VB.TextBox txtClassroom
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 3720
TabIndex = 6
Top = 1200
Width = 1692
End
Begin VB.TextBox txtDirector
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1200
Locked = -1 'True
TabIndex = 0
Top = 1200
Width = 1332
End
Begin VB.TextBox txtClassno
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1200
MaxLength = 6
TabIndex = 2
Top = 480
Width = 1332
End
Begin VB.Label Label4
Caption = "教室:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 2880
TabIndex = 5
Top = 1200
Width = 732
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "班主任:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 120
TabIndex = 4
Top = 1200
Width = 972
End
Begin VB.Label Label2
Caption = "年級:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 2880
TabIndex = 3
Top = 480
Width = 732
End
Begin VB.Label Label1
Caption = "班號:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 1
Top = 480
Width = 732
End
End
Attribute VB_Name = "frmAddclassinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim tmp_class As Class
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtClassno.Text) Then
MsgBox "請輸入班號!", vbOKOnly + vbExclamation, "警告"
txtClassno.SetFocus
Exit Sub
End If
If Not Testtxt(comboGrade.Text) Then
MsgBox "請選擇年級!", vbOKOnly + vbExclamation, "警告"
comboGrade.SetFocus
Exit Sub
End If
If Not Testtxt(txtClassroom.Text) Then
MsgBox "請輸入教室房間號!", vbOKOnly + vbExclamation, "警告"
txtClassroom.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtClassno.Text)) Then
MsgBox "請輸入數字!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtClassno.SetFocus
End If
Set tmp_class = New Class
tmp_class.class_no = Trim(txtClassno.Text)
tmp_class.query
If tmp_class.State = 1 Then 'exist duplicated class_no
If (Trim(tmp_class.class_no) = Trim(txtClassno.Text)) Then
MsgBox "班號已經存在,請重新輸入班號!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtClassno.Text = ""
txtClassno.SetFocus
End If
End If
If tmp_class.State = 2 Then
tmp_class.classroom = Trim(txtClassroom.Text)
tmp_class.Grade = Trim(comboGrade.Text)
tmp_class.insert
End If
If InStr(tmp_class.oper_flag, "insert_ok") > 0 Then
MsgBox "添加班級信息成功!", vbOKOnly + vbExclamation, "添加班級信息"
Else
MsgBox "添加班級信息失敗!", vbOKOnly + vbExclamation, "添加班級信息"
End If
txtClassno.Text = ""
txtClassroom.Text = ""
txtClassno.SetFocus
Set tmp_class = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim res As Long
comboGrade.AddItem "小學一年級"
comboGrade.AddItem "小學二年級"
comboGrade.AddItem "小學三年級"
comboGrade.AddItem "小學四年級"
comboGrade.AddItem "小學五年級"
comboGrade.AddItem "小學六年級"
comboGrade.AddItem "初中一年級"
comboGrade.AddItem "初中二年級"
comboGrade.AddItem "初中三年級"
comboGrade.AddItem "高中一年級"
comboGrade.AddItem "高中二年級"
comboGrade.AddItem "高中三年級"
txtDirector.Locked = False
txtDirector.Text = login_user.user_Id
txtDirector.Locked = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -