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

📄 formprofessionorder.vb

📁 学生信息管理系统
💻 VB
字号:
Imports CommonDB

Public Class FormProfessionOrder
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents pnlTop As System.Windows.Forms.Panel
    Friend WithEvents lblCaption As System.Windows.Forms.Label
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents btnQuery As System.Windows.Forms.Button
    Friend WithEvents cmbProfession As System.Windows.Forms.ComboBox
    Friend WithEvents cmbCollege As System.Windows.Forms.ComboBox
    Friend WithEvents lblProfession As System.Windows.Forms.Label
    Friend WithEvents lblCollege As System.Windows.Forms.Label
    Friend WithEvents dgProfessionOrder As System.Windows.Forms.DataGrid
    Friend WithEvents dgcStuNum As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents dgcName As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents dgcAverage As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents btnExit As System.Windows.Forms.Button
    Friend WithEvents dgtsProfessionOrder As System.Windows.Forms.DataGridTableStyle
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormProfessionOrder))
        Me.pnlTop = New System.Windows.Forms.Panel
        Me.lblCaption = New System.Windows.Forms.Label
        Me.PictureBox2 = New System.Windows.Forms.PictureBox
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.dgProfessionOrder = New System.Windows.Forms.DataGrid
        Me.dgtsProfessionOrder = New System.Windows.Forms.DataGridTableStyle
        Me.dgcStuNum = New System.Windows.Forms.DataGridTextBoxColumn
        Me.dgcName = New System.Windows.Forms.DataGridTextBoxColumn
        Me.dgcAverage = New System.Windows.Forms.DataGridTextBoxColumn
        Me.btnQuery = New System.Windows.Forms.Button
        Me.cmbProfession = New System.Windows.Forms.ComboBox
        Me.cmbCollege = New System.Windows.Forms.ComboBox
        Me.lblProfession = New System.Windows.Forms.Label
        Me.lblCollege = New System.Windows.Forms.Label
        Me.btnExit = New System.Windows.Forms.Button
        Me.pnlTop.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        CType(Me.dgProfessionOrder, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'pnlTop
        '
        Me.pnlTop.Controls.Add(Me.lblCaption)
        Me.pnlTop.Controls.Add(Me.PictureBox2)
        Me.pnlTop.Controls.Add(Me.PictureBox1)
        Me.pnlTop.Dock = System.Windows.Forms.DockStyle.Top
        Me.pnlTop.Location = New System.Drawing.Point(0, 0)
        Me.pnlTop.Name = "pnlTop"
        Me.pnlTop.Size = New System.Drawing.Size(288, 48)
        Me.pnlTop.TabIndex = 5
        '
        'lblCaption
        '
        Me.lblCaption.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.lblCaption.Font = New System.Drawing.Font("隶书", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.lblCaption.ForeColor = System.Drawing.SystemColors.Desktop
        Me.lblCaption.Location = New System.Drawing.Point(88, 8)
        Me.lblCaption.Name = "lblCaption"
        Me.lblCaption.Size = New System.Drawing.Size(112, 32)
        Me.lblCaption.TabIndex = 2
        Me.lblCaption.Text = "专业排名"
        Me.lblCaption.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'PictureBox2
        '
        Me.PictureBox2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
        Me.PictureBox2.Location = New System.Drawing.Point(224, 8)
        Me.PictureBox2.Name = "PictureBox2"
        Me.PictureBox2.Size = New System.Drawing.Size(32, 32)
        Me.PictureBox2.TabIndex = 1
        Me.PictureBox2.TabStop = False
        '
        'PictureBox1
        '
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
        Me.PictureBox1.Location = New System.Drawing.Point(32, 8)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(32, 32)
        Me.PictureBox1.TabIndex = 0
        Me.PictureBox1.TabStop = False
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.dgProfessionOrder)
        Me.GroupBox1.Controls.Add(Me.btnQuery)
        Me.GroupBox1.Controls.Add(Me.cmbProfession)
        Me.GroupBox1.Controls.Add(Me.cmbCollege)
        Me.GroupBox1.Controls.Add(Me.lblProfession)
        Me.GroupBox1.Controls.Add(Me.lblCollege)
        Me.GroupBox1.Controls.Add(Me.btnExit)
        Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.GroupBox1.Location = New System.Drawing.Point(0, 48)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(288, 413)
        Me.GroupBox1.TabIndex = 9
        Me.GroupBox1.TabStop = False
        '
        'dgProfessionOrder
        '
        Me.dgProfessionOrder.CaptionVisible = False
        Me.dgProfessionOrder.DataMember = ""
        Me.dgProfessionOrder.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgProfessionOrder.Location = New System.Drawing.Point(8, 80)
        Me.dgProfessionOrder.Name = "dgProfessionOrder"
        Me.dgProfessionOrder.Size = New System.Drawing.Size(272, 328)
        Me.dgProfessionOrder.TabIndex = 7
        Me.dgProfessionOrder.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.dgtsProfessionOrder})
        '
        'dgtsProfessionOrder
        '
        Me.dgtsProfessionOrder.DataGrid = Me.dgProfessionOrder
        Me.dgtsProfessionOrder.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgcStuNum, Me.dgcName, Me.dgcAverage})
        Me.dgtsProfessionOrder.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgtsProfessionOrder.MappingName = ""
        Me.dgtsProfessionOrder.ReadOnly = True
        '
        'dgcStuNum
        '
        Me.dgcStuNum.Format = ""
        Me.dgcStuNum.FormatInfo = Nothing
        Me.dgcStuNum.HeaderText = "学号"
        Me.dgcStuNum.MappingName = ""
        Me.dgcStuNum.Width = 75
        '
        'dgcName
        '
        Me.dgcName.Format = ""
        Me.dgcName.FormatInfo = Nothing
        Me.dgcName.HeaderText = "姓名"
        Me.dgcName.MappingName = ""
        Me.dgcName.Width = 75
        '
        'dgcAverage
        '
        Me.dgcAverage.Format = ""
        Me.dgcAverage.FormatInfo = Nothing
        Me.dgcAverage.HeaderText = "平均成绩"
        Me.dgcAverage.MappingName = ""
        Me.dgcAverage.Width = 75
        '
        'btnQuery
        '
        Me.btnQuery.Image = CType(resources.GetObject("btnQuery.Image"), System.Drawing.Image)
        Me.btnQuery.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.btnQuery.Location = New System.Drawing.Point(200, 48)
        Me.btnQuery.Name = "btnQuery"
        Me.btnQuery.TabIndex = 6
        Me.btnQuery.Text = " 查询"
        Me.btnQuery.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'cmbProfession
        '
        Me.cmbProfession.Location = New System.Drawing.Point(40, 48)
        Me.cmbProfession.Name = "cmbProfession"
        Me.cmbProfession.Size = New System.Drawing.Size(152, 20)
        Me.cmbProfession.TabIndex = 5
        Me.cmbProfession.Text = "请选择..."
        '
        'cmbCollege
        '
        Me.cmbCollege.Location = New System.Drawing.Point(40, 24)
        Me.cmbCollege.Name = "cmbCollege"
        Me.cmbCollege.Size = New System.Drawing.Size(152, 20)
        Me.cmbCollege.TabIndex = 4
        Me.cmbCollege.Text = "请选择..."
        '
        'lblProfession
        '
        Me.lblProfession.AutoSize = True
        Me.lblProfession.Location = New System.Drawing.Point(8, 56)
        Me.lblProfession.Name = "lblProfession"
        Me.lblProfession.Size = New System.Drawing.Size(29, 17)
        Me.lblProfession.TabIndex = 2
        Me.lblProfession.Text = "专业"
        '
        'lblCollege
        '
        Me.lblCollege.AutoSize = True
        Me.lblCollege.Location = New System.Drawing.Point(8, 32)
        Me.lblCollege.Name = "lblCollege"
        Me.lblCollege.Size = New System.Drawing.Size(29, 17)
        Me.lblCollege.TabIndex = 1
        Me.lblCollege.Text = "学院"
        '
        'btnExit
        '
        Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.btnExit.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.btnExit.ForeColor = System.Drawing.SystemColors.ControlText
        Me.btnExit.Image = CType(resources.GetObject("btnExit.Image"), System.Drawing.Image)
        Me.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.btnExit.Location = New System.Drawing.Point(200, 24)
        Me.btnExit.Name = "btnExit"
        Me.btnExit.TabIndex = 10
        Me.btnExit.Text = " 退出"
        Me.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'FormProfessionOrder
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(288, 461)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.pnlTop)
        Me.Name = "FormProfessionOrder"
        Me.Text = "FormProfessionOrder"
        Me.pnlTop.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        CType(Me.dgProfessionOrder, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    '窗体Load事件,进行各下拉框初始化
    Private Sub FormProfessionOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '初始化学院下拉框
        Me.cmbCollege.ValueMember = "id"
        Me.cmbCollege.DisplayMember = "name"
        Me.cmbCollege.DataSource = DbBase.DataInterface.Execute4DS("select id,name from college").Tables(0).DefaultView

        '初始化专业下拉框
        Me.cmbProfession.ValueMember = "id"
        Me.cmbProfession.DisplayMember = "name"

        '初始化数据网格
        Me.dgtsProfessionOrder.MappingName = "Table"
        Me.dgcName.MappingName = "student_name"
        Me.dgcStuNum.MappingName = "stu_num"
        Me.dgcAverage.MappingName = "average_point"
    End Sub

    '改变“学院”下拉框选项时,更新“专业”下拉框显示项目
    Private Sub cmbCollege_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbCollege.SelectedIndexChanged
        Me.cmbProfession.DataSource = DbBase.DataInterface.Execute4DS("select id,name from profession where college_id = " & cmbCollege.SelectedValue).Tables(0).DefaultView
    End Sub

    '查询按钮单击,调用Achievement.StudentOrder()方法查询专业内学生排名
    Private Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
        Me.dgProfessionOrder.DataSource = Achievement.StudentOrder(cmbProfession.SelectedValue).Tables(0).DefaultView
    End Sub

    '退出按钮单击
    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

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