⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmteaselect.frm

📁 这是一个选课系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   Begin VB.Image imgTitleMinimize 
      Height          =   210
      Left            =   7920
      Picture         =   "frmteaselect.frx":3776
      Stretch         =   -1  'True
      Top             =   120
      Width           =   210
   End
   Begin VB.Image imgTitleHelp 
      Height          =   210
      Left            =   7440
      Picture         =   "frmteaselect.frx":39C0
      Stretch         =   -1  'True
      Top             =   120
      Width           =   210
   End
   Begin VB.Image imgTitleclose 
      Height          =   195
      Left            =   8400
      Picture         =   "frmteaselect.frx":3C0A
      ToolTipText     =   "Close"
      Top             =   120
      Width           =   195
   End
   Begin VB.Image imgTitleMaximize 
      Height          =   195
      Left            =   6960
      Picture         =   "frmteaselect.frx":3E54
      ToolTipText     =   "Maximize (Disabled)"
      Top             =   120
      Visible         =   0   'False
      Width           =   195
   End
   Begin VB.Image imgWindowLeft 
      Height          =   450
      Left            =   1080
      Picture         =   "frmteaselect.frx":409E
      Stretch         =   -1  'True
      Top             =   480
      Width           =   285
   End
   Begin VB.Image imgWindowRight 
      Height          =   450
      Left            =   720
      Picture         =   "frmteaselect.frx":47E8
      Stretch         =   -1  'True
      Top             =   480
      Width           =   285
   End
   Begin VB.Image imgTitleLeft 
      Height          =   450
      Left            =   0
      Picture         =   "frmteaselect.frx":4F32
      Top             =   0
      Width           =   285
   End
   Begin VB.Image imgTitleRight 
      Height          =   450
      Left            =   360
      Picture         =   "frmteaselect.frx":567C
      Top             =   0
      Width           =   285
   End
   Begin VB.Image imgWindowBottom 
      Height          =   450
      Left            =   360
      Picture         =   "frmteaselect.frx":5DC6
      Stretch         =   -1  'True
      Top             =   480
      Width           =   285
   End
   Begin VB.Image imgTitleMain 
      Height          =   450
      Left            =   0
      Picture         =   "frmteaselect.frx":6510
      Stretch         =   -1  'True
      Top             =   450
      Width           =   285
   End
   Begin VB.Image imgWindowBottomLeft 
      Height          =   450
      Left            =   720
      Picture         =   "frmteaselect.frx":6C5A
      Top             =   0
      Width           =   285
   End
   Begin VB.Image imgWindowBottomRight 
      Height          =   450
      Left            =   1080
      Picture         =   "frmteaselect.frx":73A4
      Top             =   0
      Width           =   285
   End
End
Attribute VB_Name = "frmteaselect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mrc As ADODB.Recordset
Dim txtstring As String
Dim MsgText As String

Private Sub Form_Load()
    Dim i As Integer
    MakeWindow Me
    txtstring = "select * from teacher  where Tno='" & user_name & "'"
    Set mrc = MyDB.ExecuteSQL(txtstring, MsgText)
    If Not mrc.EOF Then
       Label4.Caption = mrc.Fields(1)
    End If
    mrc.Close
    txtstring = "select * from course"
    Set mrc = MyDB.ExecuteSQL(txtstring, MsgText)
    For i = 0 To mrc.RecordCount - 1
       List1.AddItem mrc.Fields(1)
        mrc.MoveNext
    Next
    mrc.Close
     txtstring = "select cname from course,T_choose where tno='" & user_name & "' and T_choose.cno=course.cno"
     Set mrc = MyDB.ExecuteSQL(txtstring, MsgText)
     For i = 0 To mrc.RecordCount - 1
         List2.AddItem mrc.Fields(0)
         mrc.MoveNext
     Next
     mrc.Close
   
End Sub

Private Sub imgTitleclose_Click()
    intNumField = -2
    Unload Me
End Sub

Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoDrag Me
End Sub

Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoDrag Me
End Sub

Private Sub imgTitleMinimize_Click()
    Me.WindowState = 1
End Sub

Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoDrag Me
End Sub







Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoDrag Me
End Sub


Private Sub SmartNetXpButton1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim i As Integer
    Dim k As Integer
    Dim sqlstring As String
    Dim mrcc As ADODB.Recordset
    Dim ccno As String
    k = 0
   
    For i = 0 To List2.ListCount - 1
       If List2.List(i) = List1.Text Then k = 1
    Next
  
   sqlstring = "select * from T_choose,course  where  T_choose.Cno=course.Cno and Cname= '" & Trim(List1.Text) & "' and tno='" & Trim(user_name) & "'"
   
   Set mrcc = MyDB.ExecuteSQL(sqlstring, MsgText)
   
   
    
   If Not mrcc.EOF Then k = 1
   

   mrcc.Close
  
   
  
  If k <> 1 Then
  
      If List1.ListIndex <> -1 Then
         sqlstring = "select Cno from course where Cname='" & Trim(List1.Text) & " '"
  
          Set mrcc = MyDB.ExecuteSQL(sqlstring, MsgText)
          If Not mrcc.EOF Then
            ccno = mrcc.Fields(0)
           End If
    
           mrcc.Close
     
        txtstring = "select * from T_choose"
       Set mrc = MyDB.ExecuteSQL(txtstring, MsgText)
      
        mrc.AddNew
      
        If Not mrc.EOF Then
          mrc.Fields(1) = ccno
          mrc.Fields(2) = user_name
        End If
      
        mrc.Update
        
        MsgBox "选课成功", vbOKOnly + vbExclamation, "祝贺"
        mrc.Close
         
        List2.AddItem List1.Text
         
      Else
       
         MsgBox "请选中你要教的课程", vbInformation + vbOKOnly, "提示"
         Exit Sub
      End If
  Else
     MsgBox "你已经选了该课程,请重选!", vbInformation + vbOKOnly, "提示"
     Exit Sub
  End If
End Sub


Private Sub SmartNetXpButton2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Dim ccno As String
     Dim mrcc As ADODB.Recordset
       
    txtstring = "select Cno from course where  cname='" & Trim(List2.Text) & "'"
     Set mrcc = MyDB.ExecuteSQL(txtstring, MsgText)
       If Not mrcc.EOF Then
         ccno = mrcc.Fields(0)
       End If
     mrcc.Close
     If List2.ListIndex <> -1 Then
        
         txtstring = "delete from T_choose where Cno='" & Trim(ccno) & "' and Tno='" & Trim(user_name) & "'"
     
         Set mrcc = MyDB.ExecuteSQL(txtstring, MsgText)
     
          List2.RemoveItem List2.ListIndex
          
          MsgBox "你已退选该课程", vbInformation + vbOKOnly, "提示"
     Else
           MsgBox "请选择要退选的课程", vbInformation + vbOKOnly, "提示"
           
     End If
End Sub

Private Sub SmartNetXpButton3_Click()
  frmteazhacouinfo.Show
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -