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

📄 课表查询.vb

📁 Here we are at the crossroads once again Youre telling me youre so confused You cant make up your
💻 VB
📖 第 1 页 / 共 2 页
字号:
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(496, 20)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(66, 17)
        Me.Label4.TabIndex = 26
        Me.Label4.Text = "按教师查询"
        '
        'ComboBox3
        '
        Me.ComboBox3.Location = New System.Drawing.Point(408, 16)
        Me.ComboBox3.Name = "ComboBox3"
        Me.ComboBox3.Size = New System.Drawing.Size(88, 20)
        Me.ComboBox3.TabIndex = 25
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(344, 21)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(66, 17)
        Me.Label3.TabIndex = 24
        Me.Label3.Text = "按教室查询"
        '
        'ComboBox2
        '
        Me.ComboBox2.Location = New System.Drawing.Point(248, 16)
        Me.ComboBox2.Name = "ComboBox2"
        Me.ComboBox2.Size = New System.Drawing.Size(96, 20)
        Me.ComboBox2.TabIndex = 23
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(184, 21)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(66, 17)
        Me.Label2.TabIndex = 22
        Me.Label2.Text = "按班级查询"
        '
        'ComboBox1
        '
        Me.ComboBox1.Location = New System.Drawing.Point(80, 16)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(96, 20)
        Me.ComboBox1.TabIndex = 21
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(16, 20)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(66, 17)
        Me.Label1.TabIndex = 20
        Me.Label1.Text = "按院系查询"
        '
        'frmLessonTable
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BackColor = System.Drawing.SystemColors.InactiveCaptionText
        Me.ClientSize = New System.Drawing.Size(870, 428)
        Me.Controls.Add(Me.GroupBox2)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.Panel2)
        Me.Controls.Add(Me.Panel1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmLessonTable"
        Me.Opacity = 0.9
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "课表信息查询"
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmLessonTable_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        sql.SQLDataReader("select * from department")
        While sql.SQLDR.Read()
            ComboBox1.Items.Add(sql.SQLDR.GetValue(1))
        End While
        sql.SQLDR.Close()

        sql.SQLDataReader("select * from class")
        While sql.SQLDR.Read()
            ComboBox2.Items.Add(sql.SQLDR.GetValue(1))
        End While
        sql.SQLDR.Close()

        sql.SQLDataReader("select * from classRoom")
        While sql.SQLDR.Read
            ComboBox3.Items.Add(sql.SQLDR.GetValue(0))
        End While
        sql.SQLDR.Close()

        sql.SQLDataReader("select * from Teacher")
        While sql.SQLDR.Read
            ComboBox4.Items.Add(sql.SQLDR.GetValue(1))
        End While
        sql.SQLDR.Close()

        LoatData("select * from vw_lessonTable ")
    End Sub
    Sub LoatData(ByVal strSelect As String)
        Me.lvw_LessonTable.Items.Clear()
        Dim itemLT As ListViewItem
        sql.SQLDataReader(strSelect)
        While sql.SQLDR.Read
            itemLT = lvw_LessonTable.Items.Add(sql.SQLDR.GetValue(0))
            itemLT.SubItems.Add(sql.SQLDR.GetValue(1))
            itemLT.SubItems.Add(sql.SQLDR.GetValue(2))
            itemLT.SubItems.Add(sql.SQLDR.GetValue(3))
            itemLT.SubItems.Add(sql.SQLDR.GetValue(4))
            itemLT.SubItems.Add(sql.SQLDR.GetValue(5))

            Select Case sql.SQLDR.GetValue(6)
                Case "1"
                    itemLT.SubItems.Add("第一学期")
                Case Else
                    itemLT.SubItems.Add("第二学期")
            End Select
            Select Case sql.SQLDR.GetValue(7)
                Case "1"
                    itemLT.SubItems.Add("星期一")
                Case "2"
                    itemLT.SubItems.Add("星期二")
                Case "3"
                    itemLT.SubItems.Add("星期三")
                Case "4"
                    itemLT.SubItems.Add("星期四")
                Case "5"
                    itemLT.SubItems.Add("星期五")
                Case "6"
                    itemLT.SubItems.Add("星期六")
                Case Else
                    itemLT.SubItems.Add("星期天")
            End Select
            Select Case sql.SQLDR.GetValue(8)
                Case "1"
                    itemLT.SubItems.Add("1、2节")
                Case "2"
                    itemLT.SubItems.Add("3、4节")
                Case "3"
                    itemLT.SubItems.Add("5、6节")
                Case "4"
                    itemLT.SubItems.Add("7、8节")
                Case Else
                    itemLT.SubItems.Add("9、10节")
            End Select

            Select Case sql.SQLDR.GetValue(9)
                Case "0"
                    itemLT.SubItems.Add("单双周")
                Case "1"
                    itemLT.SubItems.Add("单周")
                Case "2"
                    itemLT.SubItems.Add("双周")
            End Select

        End While
        sql.SQLDR.Close()
    End Sub

   
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If ComboBox1.Text <> "" And ComboBox2.Text <> "" And ComboBox3.Text <> "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "' and CLass_Name='" & ComboBox2.Text & "' and CR_Number='" & ComboBox3.Text & "' and Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        ElseIf ComboBox1.Text <> "" And ComboBox2.Text <> "" And ComboBox3.Text <> "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "' and CLass_Name='" & ComboBox2.Text & "' and CR_Number='" & ComboBox3.Text & "' "
            LoatData(str)
        ElseIf ComboBox1.Text <> "" And ComboBox2.Text <> "" And ComboBox3.Text = "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "' and CLass_Name='" & ComboBox2.Text & "'"
            LoatData(str)
        ElseIf ComboBox1.Text <> "" And ComboBox2.Text = "" And ComboBox3.Text = "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "'"
            LoatData(str)
        ElseIf ComboBox1.Text = "" And ComboBox2.Text <> "" And ComboBox3.Text <> "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where  CLass_Name='" & ComboBox2.Text & "' and CR_Number='" & ComboBox3.Text & "' and Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        ElseIf ComboBox1.Text = "" And ComboBox2.Text <> "" And ComboBox3.Text <> "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where CLass_Name='" & ComboBox2.Text & "' and CR_Number='" & ComboBox3.Text & "' "
            LoatData(str)

        ElseIf ComboBox1.Text = "" And ComboBox2.Text <> "" And ComboBox3.Text = "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where  CLass_Name='" & ComboBox2.Text & "' "
            LoatData(str)
        ElseIf ComboBox1.Text = "" And ComboBox2.Text = "" And ComboBox3.Text <> "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where  CR_Number='" & ComboBox3.Text & "'and Tea_Name='" & ComboBox4.Text & "' "
            LoatData(str)

        ElseIf ComboBox1.Text = "" And ComboBox2.Text = "" And ComboBox3.Text <> "" And ComboBox4.Text = "" Then
            Dim str As String
            str = "select * from vw_lessonTable where CR_Number='" & ComboBox3.Text & "' "
            LoatData(str)

        ElseIf ComboBox1.Text = "" And ComboBox2.Text = "" And ComboBox3.Text = "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where  Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        ElseIf ComboBox1.Text <> "" And ComboBox2.Text <> "" And ComboBox3.Text = "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "' and  CLass_Name='" & ComboBox2.Text & "' and Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        ElseIf ComboBox1.Text <> "" And ComboBox2.Text = "" And ComboBox3.Text <> "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where Dep_Name='" & ComboBox1.Text & "' and CR_Number='" & ComboBox3.Text & "' and Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        ElseIf ComboBox1.Text = "" And ComboBox2.Text <> "" And ComboBox3.Text = "" And ComboBox4.Text <> "" Then
            Dim str As String
            str = "select * from vw_lessonTable where  CLass_Name='" & ComboBox2.Text & "'  and Tea_Name='" & ComboBox4.Text & "'  "
            LoatData(str)
        End If
    End Sub
End Class

⌨️ 快捷键说明

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