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

    Private WithEvents theSetlists As New Setlist

    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

    Public Function GetTimesPlayed(ByVal songnum As Integer) As String
        Return theSetlists.NumTimesPlayed(songnum).ToString
    End Function

    Public Function GetPercentage(ByVal songnum As Integer) As String
        Dim percent As Double
        percent = theSetlists.NumTimesPlayed(songnum) / theSetlists.NumberOfSetlists()
        Return percent.ToString("##0.000%")
    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