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

    Private WithEvents theShow As Show
    Private flag As Boolean

    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
    End Sub

    Protected Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        If Page.IsValid Then
            flag = True
            theShow = New Show
            theShow.Year = CInt(tbYear.Text)
            theShow.Month = CInt(tbMonth.Text)
            theShow.Day = CInt(tbDay.Text)
            theShow.City = tbCity.Text
            If Not tbState.Text = "" Then
                theShow.State = tbState.Text
            End If
            theShow.Country = tbCountry.Text
            theShow.Venue = tbVenue.Text
            If Not tbNotes.Text = "" Then
                theShow.Notes = tbNotes.Text
            End If
            theShow.Verified = cbVerified.Checked
            theShow.Save()
            If flag Then
                Response.Redirect("../DisplayShow.aspx?ShowNumber=" + theShow.ShowNumber.ToString)
            End If
        End If
    End Sub

    Private Sub theShow_DBError(ByVal message As String) Handles theShow.DBError
        flag = False
    End Sub

    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