<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/addAlbum.aspx">创建专辑</asp:HyperLink><br />
        专辑名称&nbsp;
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ObjectDataSource1"
            DataTextField="albumName" DataValueField="albumID">
        </asp:DropDownList>
        <asp:Button ID="Button1" runat="server" Text="查询" OnClick="Button1_Click" />
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAlbumName"
            TypeName="DB"></asp:ObjectDataSource>
        &nbsp;
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource2" PageSize="3" BackColor="#DEBA84" BorderColor="#DEBA84" BorderWidth="1px" CellPadding="3" BorderStyle="None" CellSpacing="2" DataKeyNames="albumID" >
            <Columns>
                <asp:BoundField DataField="albumID" HeaderText="专集编号" />
                <asp:BoundField DataField="albumName" HeaderText="专集名称" />
                <asp:BoundField DataField="albumTime" HeaderText="专集创建时间" />
                <asp:TemplateField HeaderText="专集封面">
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("logoUrl") %>' Height="100px" Width="100px" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:HyperLinkField Text="为专集添加图片" DataNavigateUrlFields="albumID" DataNavigateUrlFormatString="addImage.aspx?id={0}" />
                <asp:HyperLinkField Text="浏览专集图片" DataNavigateUrlFields="albumID" DataNavigateUrlFormatString="ViewImage.aspx?id={0}" />
                <asp:HyperLinkField Text="修改专集" DataNavigateUrlFields="albumID" DataNavigateUrlFormatString="updateAlbum.aspx?id={0}" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <SelectedRowStyle BackColor="#738A9C" ForeColor="White" Font-Bold="True" />
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetAll"
            TypeName="DB" DeleteMethod="delete">
            <DeleteParameters>
                <asp:Parameter Name="albumID" Type="Int32" />
            </DeleteParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="GetByID"
            TypeName="DB">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="id" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
