Public Class SelectionForm
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    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

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents ComboSelection As System.Windows.Forms.ComboBox
    Friend WithEvents cmdOK As System.Windows.Forms.Button
    Friend WithEvents cmdExit As System.Windows.Forms.Button
    Friend WithEvents TitleLabel As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TitleLabel = New System.Windows.Forms.Label
        Me.ComboSelection = New System.Windows.Forms.ComboBox
        Me.cmdOK = New System.Windows.Forms.Button
        Me.cmdExit = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'TitleLabel
        '
        Me.TitleLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TitleLabel.Location = New System.Drawing.Point(22, 22)
        Me.TitleLabel.Name = "TitleLabel"
        Me.TitleLabel.Size = New System.Drawing.Size(232, 23)
        Me.TitleLabel.TabIndex = 0
        Me.TitleLabel.Text = "Make Your Selection"
        Me.TitleLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'ComboSelection
        '
        Me.ComboSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple
        Me.ComboSelection.Location = New System.Drawing.Point(35, 48)
        Me.ComboSelection.Name = "ComboSelection"
        Me.ComboSelection.Size = New System.Drawing.Size(208, 88)
        Me.ComboSelection.TabIndex = 1
        Me.ComboSelection.Text = "Faculty Information "
        '
        'cmdOK
        '
        Me.cmdOK.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdOK.Location = New System.Drawing.Point(35, 142)
        Me.cmdOK.Name = "cmdOK"
        Me.cmdOK.Size = New System.Drawing.Size(75, 23)
        Me.cmdOK.TabIndex = 2
        Me.cmdOK.Text = "OK"
        '
        'cmdExit
        '
        Me.cmdExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.Location = New System.Drawing.Point(168, 142)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(75, 23)
        Me.cmdExit.TabIndex = 3
        Me.cmdExit.Text = "Exit"
        '
        'SelectionForm
        '
        Me.AcceptButton = Me.cmdOK
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(277, 185)
        Me.Controls.Add(Me.cmdExit)
        Me.Controls.Add(Me.cmdOK)
        Me.Controls.Add(Me.ComboSelection)
        Me.Controls.Add(Me.TitleLabel)
        Me.Name = "SelectionForm"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Selection Form"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub SelectForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboSelection.Items.Add("Faculty Information")
        ComboSelection.Items.Add("Courses Information")
        ComboSelection.Items.Add("Students Information")
        ComboSelection.Items.Add("SP Information")
        ComboSelection.SelectedIndex = 0
    End Sub

    Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        If LogInForm.sqlConnection.State = ConnectionState.Open Then
            LogInForm.sqlConnection.Close()
            LogInForm.sqlConnection.Dispose()
            LogInForm.sqlConnection = Nothing
        End If
        Application.Exit()
    End Sub

    Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
        Dim facultyform As New FacultyForm
        Dim studentform As New StudentForm
        Dim courseform As New CourseForm
        Dim spform As New SPForm

        If ComboSelection.Text = "Faculty Information" Then
            facultyform.Show()
        ElseIf ComboSelection.Text = "Students Information" Then
            studentform.Show()
        ElseIf ComboSelection.Text = "Courses Information" Then
            courseform.Show()
        ElseIf ComboSelection.Text = "SP Information" Then
            spform.Show()
        End If
    End Sub
End Class
