<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SongStats.aspx.vb" Inherits="Metallica.Webforms_SongStats" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Song Statistics</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Panel
            ID="Panel1" runat="server" Height="8px" Width="537px">
            <a href="Index.aspx"><span style="font-size: 10pt; font-family: Arial">Home</span></a>&nbsp;
            &nbsp; <a href="AllSongs.aspx"><span style="font-size: 10pt; font-family: Arial">View All Songs</span></a>&nbsp;
            &nbsp; <a href="SongStats.aspx"><span style="font-size: 10pt; font-family: Arial">View Song
                Statistics</span></a>&nbsp;&nbsp; &nbsp;<a href="AllShows.aspx"><span style="font-size: 10pt; font-family: Arial">View All Shows</span></a>&nbsp;&nbsp;
            &nbsp;<a href="UserFiles/AddShow.aspx"><span style="font-size: 10pt; font-family: Arial">Add
                a Show</span></a>&nbsp;&nbsp; &nbsp;<asp:LinkButton ID="lbSignOut" runat="server" Font-Names="Arial" Font-Size="Small"
            Visible="False">Log Out</asp:LinkButton></asp:Panel>
        <br />
         <br /><strong><span style="font-size: 16pt; font-family: Arial">Song Statistics</span></strong><br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="SongNumber"
            DataSourceID="SqlDataSource1" Font-Names="arial" Font-Size="Small" GridLines="Vertical">
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="SongNumber" DataNavigateUrlFormatString="~/Webforms/DisplaySong.aspx?SongNumber={0}"
                    DataTextField="Name" DataTextFormatString="{0}" HeaderText="Song" NavigateUrl="~/Webforms/DisplaySong.aspx?SongNumber=" />
                <asp:TemplateField HeaderText="# of Times Played">
                <ItemTemplate>
							<asp:Label ID="Label1" runat="server" Text='<%# GetTimesPlayed(DataBinder.Eval(Container, "DataItem.SongNumber")) %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox ID="TextBox1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.SongNumber") %>'>
							</asp:TextBox>
						</EditItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Percentage">
                <ItemTemplate>
							<asp:Label ID="Label2" runat="server" Text='<%# GetPercentage(DataBinder.Eval(Container, "DataItem.SongNumber")) %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox ID="TextBox2" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.SongNumber") %>'>
							</asp:TextBox>
						</EditItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" Font-Underline="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="Gainsboro" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Metallica.My.MySettings.csMetallica %>"
            SelectCommand="SELECT * FROM [Song] WHERE ([SongNumber] < @SongNumber) ORDER BY [Name]">
            <SelectParameters>
                <asp:Parameter DefaultValue="128" Name="SongNumber" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
