Public Partial Class Webforms_DisplayShow
    Inherits System.Web.UI.Page

    Private WithEvents theShow As New Show
    Private WithEvents theSetlist As New Setlist
    Private WithEvents theSong As New Song

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If User.Identity.Name <> "" Then
            lbSignOut.Visible = True
        End If

        Dim strShowNum As String
        Dim intShowNum As Integer
        strShowNum = Request.QueryString("ShowNumber")
        intShowNum = CInt(strShowNum)
        If Not theShow.Exists(intShowNum) Then
            Response.Redirect("ResponsePages/PageNotFound.aspx")
        End If
        theShow.Item(intShowNum)
        lblDate.Text = ConvertToMonth(theShow.Month) + " " + theShow.Day.ToString + ", " + theShow.Year.ToString
        If String.IsNullOrEmpty(theShow.State) Then
            lblLocation.Text = theShow.City + ", " + theShow.Country
        Else
            lblLocation.Text = theShow.City + ", " + theShow.State + ", " + theShow.Country
        End If
        lblVenue.Text = theShow.Venue
        If Not String.IsNullOrEmpty(theShow.Notes) Then
            lblNotes.Text = theShow.Notes
        Else
            lblNotesLbl.Visible = False
        End If
        imgVerified.Visible = theShow.Verified

        If theSetlist.ExistsByShow(theShow.ShowNumber) Then
            lblSetlist.Text = "Setlist:"
            lblSetlist.Visible = True
            theSetlist.Item(theSetlist.GetSetlistNumberByShow(theShow.ShowNumber))
            HyperLink1.Text = theSong.GetName(theSetlist.Song01)
            HyperLink2.Text = theSong.GetName(theSetlist.Song02)
            HyperLink3.Text = theSong.GetName(theSetlist.Song03)
            HyperLink4.Text = theSong.GetName(theSetlist.Song04)
            HyperLink5.Text = theSong.GetName(theSetlist.Song05)
            HyperLink6.Text = theSong.GetName(theSetlist.Song06)
            HyperLink7.Text = theSong.GetName(theSetlist.Song07)
            HyperLink8.Text = theSong.GetName(theSetlist.Song08)
            HyperLink9.Text = theSong.GetName(theSetlist.Song09)
            HyperLink10.Text = theSong.GetName(theSetlist.Song10)
            HyperLink11.Text = theSong.GetName(theSetlist.Song11)
            HyperLink12.Text = theSong.GetName(theSetlist.Song12)
            HyperLink13.Text = theSong.GetName(theSetlist.Song13)
            HyperLink14.Text = theSong.GetName(theSetlist.Song14)
            HyperLink15.Text = theSong.GetName(theSetlist.Song15)
            HyperLink16.Text = theSong.GetName(theSetlist.Song16)
            HyperLink17.Text = theSong.GetName(theSetlist.Song17)
            HyperLink18.Text = theSong.GetName(theSetlist.Song18)
            HyperLink19.Text = theSong.GetName(theSetlist.Song19)
            HyperLink20.Text = theSong.GetName(theSetlist.Song20)
            HyperLink21.Text = theSong.GetName(theSetlist.Song21)
            HyperLink22.Text = theSong.GetName(theSetlist.Song22)
            HyperLink23.Text = theSong.GetName(theSetlist.Song23)
            HyperLink24.Text = theSong.GetName(theSetlist.Song24)
            HyperLink25.Text = theSong.GetName(theSetlist.Song25)

            HyperLink1.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song01.ToString
            HyperLink2.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song02.ToString
            HyperLink3.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song03.ToString
            HyperLink4.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song04.ToString
            HyperLink5.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song05.ToString
            HyperLink6.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song06.ToString
            HyperLink7.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song07.ToString
            HyperLink8.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song08.ToString
            HyperLink9.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song09.ToString
            HyperLink10.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song10.ToString
            HyperLink11.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song11.ToString
            HyperLink12.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song12.ToString
            HyperLink13.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song13.ToString
            HyperLink14.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song14.ToString
            HyperLink15.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song15.ToString
            HyperLink16.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song16.ToString
            HyperLink17.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song17.ToString
            HyperLink18.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song18.ToString
            HyperLink19.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song19.ToString
            HyperLink20.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song20.ToString
            HyperLink21.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song21.ToString
            HyperLink22.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song22.ToString
            HyperLink23.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song23.ToString
            HyperLink24.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song24.ToString
            HyperLink25.NavigateUrl = "~/Webforms/DisplaySong.aspx?SongNumber=" + theSetlist.Song25.ToString
        Else
            hlAddSetlist.Visible = True
            hlAddSetlist.NavigateUrl = "~/Webforms/UserFiles/AddSetlist.aspx?ShowNumber=" + theShow.ShowNumber.ToString
            HyperLink1.Visible = False
            HyperLink2.Visible = False
            HyperLink3.Visible = False
            HyperLink4.Visible = False
            HyperLink5.Visible = False
            HyperLink6.Visible = False
            HyperLink7.Visible = False
            HyperLink8.Visible = False
            HyperLink9.Visible = False
            HyperLink10.Visible = False
            HyperLink11.Visible = False
            HyperLink12.Visible = False
            HyperLink13.Visible = False
            HyperLink14.Visible = False
            HyperLink15.Visible = False
            HyperLink16.Visible = False
            HyperLink17.Visible = False
            HyperLink18.Visible = False
            HyperLink19.Visible = False
            HyperLink20.Visible = False
            HyperLink21.Visible = False
            HyperLink22.Visible = False
            HyperLink23.Visible = False
            HyperLink24.Visible = False
            HyperLink25.Visible = False
        End If
    End Sub

    Public Function ConvertToMonth(ByVal month As Integer) As String
        Select Case month
            Case 1
                Return "January"
            Case 2
                Return "February"
            Case 3
                Return "March"
            Case 4
                Return "April"
            Case 5
                Return "May"
            Case 6
                Return "June"
            Case 7
                Return "July"
            Case 8
                Return "August"
            Case 9
                Return "September"
            Case 10
                Return "October"
            Case 11
                Return "November"
            Case 12
                Return "December"
            Case Else
                Return "Invalid Month"
        End Select
    End Function

    Protected Sub lbSignOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbSignOut.Click
        System.Web.Security.FormsAuthentication.SignOut()
        lbSignOut.Visible = False
    End Sub
End Class