<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AlbumsBLL.aspx.cs" Inherits="MyTunes.BLLObjectBinding.AlbumsBLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <asp:Label ID="lblDebug" runat="server" 
            Text="Object (Business Logic Layer) Binding Example - Albums with Default Paging and Sorting" 
            Font-Bold="True" ForeColor="Red"></asp:Label>
    </div>
    <div>
        <table style="width: 100%">
            <tr>
                <td>
                <asp:Label ID="lblAlbumFilter" runat="server" Text="Album Quick Search"></asp:Label>
                <asp:TextBox ID="txtAlbumFilter" runat="server" 
                        ontextchanged="txtAlbumFilter_TextChanged"></asp:TextBox>&nbsp;
                <asp:ImageButton ID="ImageButton1" runat="server" 
                        ImageUrl="~/App_Themes/Default/Images/rarrow.gif" 
                        onclick="btnFilterGo_Click" ToolTip="Run Search" />
                </td>
                <td style="text-align: center">
                    <asp:Label ID="lblPageInfo" runat="server" Font-Italic="True"></asp:Label>
                </td>
                <td align="right" class="style1" valign="middle">
        <asp:Label ID="lblPageSelect" runat="server" Text="Jump to:"></asp:Label>
        <asp:DropDownList
            ID="lstPageSelect" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="lstPageSelect_SelectedIndexChanged">
        </asp:DropDownList>
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="AlbumBLLGridView" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="album_id" 
        DataSourceID="MyTunesAlbumBLL" PageSize="25" 
    ondatabound="AlbumBLLGridView_DataBound">
        <Columns>
            <asp:BoundField DataField="artist_id" HeaderText="Artist ID" 
                SortExpression="artist_id" />
            <asp:BoundField DataField="album_id" HeaderText="Album ID" ReadOnly="True" 
                SortExpression="album_id" />
            <asp:BoundField DataField="album" HeaderText="Album" SortExpression="album" />
        </Columns>
        <PagerSettings Mode="NumericFirstLast" PageButtonCount="25" />
    </asp:GridView>
    <asp:ObjectDataSource ID="MyTunesAlbumBLL" runat="server" 
        DeleteMethod="DeleteAlbum" InsertMethod="AddAlbum" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetAlbums" 
        TypeName="MyTunes.Common.BLL.AlbumBLL" UpdateMethod="UpdateAlbum">
        <DeleteParameters>
            <asp:Parameter Name="albumID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="artistID" Type="Int32" />
            <asp:Parameter Name="albumName" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="albumID" Type="Int32" />
            <asp:Parameter Name="albumName" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>
