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

<!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:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataKeyNames="imageID" DataSourceID="ObjectDataSource1" PageSize="4" OnPageIndexChanging="GridView1_PageIndexChanging">
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="imageID" HeaderText="图片编号" />
                <asp:BoundField DataField="imageUrl" HeaderText="图片地址" />
                <asp:BoundField DataField="imageName" HeaderText="图片名称" />
                <asp:BoundField DataField="albumName" HeaderText="所属专辑名称" />
                <asp:BoundField DataField="imageTime" HeaderText="图片上传时间" />
                <asp:BoundField DataField="imageDesc" HeaderText="图片简介" />
                <asp:TemplateField>
                    <HeaderTemplate>
                        &nbsp;<asp:CheckBox ID="CheckBox1" runat="server" Text="全选" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox2" runat="server" OnCheckedChanged="CheckBox2_CheckedChanged" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="删除所有记录" />&nbsp;<asp:Button
            ID="Button2" runat="server" OnClick="Button2_Click" Text="返回" /><br />
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="showImage"
            TypeName="DB">
            <SelectParameters>
                <asp:QueryStringParameter Name="albumID" QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        &nbsp;<br />
        <asp:DataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource2" RepeatColumns="3"
            RepeatDirection="Horizontal">
            <ItemTemplate>
                <table >
                    <tr>
                       
                        <td style="width: 104px" align=center colspan=2>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("imageUrl") %>' Height="200px" Width="200px" /></td>
                    </tr>
                    <tr>
                        <td style="width: 82px">
                                    图片名称：</td>
                        <td style="width: 100px">
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("imageName") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 82px">
                            所属专辑：</td>
                        <td style="width: 100px">
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("albumName") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 82px">
                                    上传时间：</td>
                        <td style="width: 100px">
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("imageTime") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 82px; height: 21px;">
                                    图片简介：</td>
                        <td style="width: 100px; height: 21px;">
                            <asp:Label ID="Label4" runat="server" Text='<%# Eval("imageDesc") %>'></asp:Label></td>
                    </tr>
                    <tr>
                    <td colspan =2>&nbsp;<asp:DataList ID="DataList2" runat="server" DataSourceID="ObjectDataSource1" BorderColor="SpringGreen" BorderWidth="1px" GridLines="Horizontal">
                            <ItemTemplate>
                                &nbsp;<table>
                                    <tr>
                                        <td style="width: 100px">
                                            <asp:Label ID="Label5" runat="server" Text='<%# Eval("Cmturl") %>'></asp:Label>:</td>
                                        <td style="width: 100px">
                                            <asp:Label ID="Label6" runat="server" Text='<%# Eval("Content") %>'></asp:Label></td>
                                        <td style="width: 100px">
                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("Time") %>'></asp:Label></td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td style="width: 100px">
                                        <asp:Image ID="Image2" runat="server" ImageUrl="~/bjImage/smile.gif" /></td>
                                    <td style="width: 100px">
                                        <asp:Image ID="Image3" runat="server" ImageUrl="~/bjImage/message.gif" /></td>
                                    <td style="width: 100px">
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        </asp:DataList><asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="select_Cmt"
                            TypeName="DB">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="GridView1" Name="imageID" PropertyName="SelectedValue"
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </td></tr>
                    <tr>
                    <td style="width: 205px; height: 21px;" colspan=2></td></tr>
                </table>
            </ItemTemplate>
        </asp:DataList><br />
        <br />
        <br />
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="showMoreImage"
            TypeName="DB">
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
