Imports System
Imports System.ComponentModel.Design
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports System.IO


Public Class Retrieve_Session_State
    Inherits System.Web.UI.Page
    Protected WithEvents lbl_Destination_City As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents lbl_Flight_Ret2 As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Departure_City As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Return_Date As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Flight_Dest2 As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Flight_Dest As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Flight_Ret As System.Web.UI.WebControls.Label
    Protected WithEvents lbl_Departure_Date As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid
    
#Region " Web Forms Designer Generated Code "
    
    'CODEGEN: This procedure is required by the Web Form Designer
    'Do not modify it using the code editor.
    Private Sub InitializeComponent()

    End Sub

#End Region

    Protected Sub Page_Init(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadFlights()
    End Sub

    Protected Sub LoadFlights()

        'Retrieve Flight Information
        lbl_Return_Date.Text = Session("Return_Date").ToString()
        lbl_Departure_Date.Text = Session("Departure_Date").ToString()
        lbl_Destination_City.Text = Session("Destination_City").ToString()
        lbl_Departure_City.Text = Session("Departure_City").ToString()
        lbl_Flight_Ret2.Text = Session("Departure_City").ToString()
        lbl_Flight_Ret.text = Session("Destination_City").ToString()
        lbl_Flight_Dest.Text = Session("Departure_City").ToString()
        lbl_Flight_Dest2.Text = Session("Destination_City").ToString()

        'Retrieve Avaliable Flights Departure to Destination
        Dim ds_outbound_flight As New DataSet()
        Dim fs_outbound_flight As New FileStream(Server.MapPath("Flights.xml"), FileMode.Open, FileAccess.Read)
        ds_outbound_flight.readxml(fs_outbound_flight)
        fs_outbound_flight.Close()
        DataGrid1.DataSource = ds_outbound_flight.Tables(0).DefaultView
        DataGrid1.DataBind()

        'Retrieve Avaliable Flights Destination to Departure
        Dim ds_return_flight As New DataSet()
        Dim fs_return_flight As New FileStream(Server.MapPath("Flights2.xml"), FileMode.Open, FileAccess.Read)
        ds_return_flight.readxml(fs_return_flight)
        fs_return_flight.Close()
        DataGrid2.DataSource = ds_return_flight.Tables(0).DefaultView
        DataGrid2.DataBind()

    End Sub

End Class
