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

<!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>
    <link rel="stylesheet" href="1.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1" Width="807px">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:BoundField DataField="title" HeaderText="title" SortExpression="title" />
                <asp:BoundField DataField="picture" HeaderText="picture" SortExpression="picture" />
                <asp:BoundField DataField="hits" HeaderText="hits" SortExpression="hits" />
                <asp:BoundField DataField="class" HeaderText="class" SortExpression="class" />
                <asp:BoundField DataField="swf" HeaderText="swf" SortExpression="swf" />
                <asp:BoundField DataField="status" HeaderText="status" SortExpression="status" />
                 <asp:HyperLinkField DataNavigateUrlFields="id" DataNavigateUrlFormatString="addflash.aspx?id={0}" Text="修改" />
                 <asp:HyperLinkField DataNavigateUrlFields="id" DataNavigateUrlFormatString="addpic.aspx?id={0}" Text="上传" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:db %>"
            DeleteCommand="DELETE FROM [flash] WHERE [id] = @id" InsertCommand="INSERT INTO [flash] ([title], [picture], [hits], [class], [swf], [status]) VALUES (@title, @picture, @hits, @class, @swf, @status)"
            SelectCommand="SELECT [id], [title], [picture], [hits], [class], [swf], [status] FROM [flash] ORDER BY [id] DESC"
            UpdateCommand="UPDATE [flash] SET [title] = @title, [picture] = @picture, [hits] = @hits, [class] = @class, [swf] = @swf, [status] = @status WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="title" Type="String" />
                <asp:Parameter Name="picture" Type="String" />
                <asp:Parameter Name="hits" Type="Int32" />
                <asp:Parameter Name="class" Type="Int32" />
                <asp:Parameter Name="swf" Type="String" />
                <asp:Parameter Name="status" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="title" Type="String" />
                <asp:Parameter Name="picture" Type="String" />
                <asp:Parameter Name="hits" Type="Int32" />
                <asp:Parameter Name="class" Type="Int32" />
                <asp:Parameter Name="swf" Type="String" />
                <asp:Parameter Name="status" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
