<%@ Page Language="C#" MasterPageFile="~/BlogerMasterPage.master" AutoEventWireup="true" CodeFile="Resource.aspx.cs" Inherits="Bloger_BlogManage_Resource" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 568px; height: 362px">
        <tr>
            <td style="width: 100px">
                <asp:Label ID="Label1" runat="server" Text="资源管理" Font-Bold="True"></asp:Label></td>
            <td style="width: 91px">
            </td>
            <td style="width: 100px">
            </td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <hr />
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
            </td>
            <td style="width: 91px">
                &nbsp;<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="上传" /></td>
            <td style="width: 100px">
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="下载" /></td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
            </td>
            <td colspan="2">
                </td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
            </td>
            <td colspan="2">
                <asp:Label ID="Label2" runat="server" Font-Bold="True" ForeColor="#004040" Text="个人资源管理中心"></asp:Label></td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td style="height: 36px" colspan="4">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="resource_id"
                    DataSourceID="SqlDataSource1" Height="10px" Width="529px" OnRowDeleting="GridView1_RowDeleting" AllowPaging="True" PageSize="8" CellPadding="4" ForeColor="#333333" GridLines="None">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                    OnClientClick='return confirm("确认删除？")' Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="file_name" HeaderText="资源名称" SortExpression="file_name" />
                        <asp:BoundField DataField="description" HeaderText="资源描述" SortExpression="description" />
                        <asp:BoundField DataField="pub_date" HeaderText="上传时间" SortExpression="pub_date" />
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <EditRowStyle BackColor="#999999" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DesertEagleConnectionString2 %>" DeleteCommand="DELETE FROM [DE_resource] WHERE [resource_id] = @original_resource_id"
        InsertCommand="INSERT INTO [DE_resource] ([bloger_name], [pub_date], [file_name], [description]) VALUES (@bloger_name, @pub_date, @file_name, @description)"
        OldValuesParameterFormatString="original_{0}" OnSelecting="SqlDataSource1_Selecting"
        SelectCommand="SELECT * FROM [DE_resource] WHERE ([bloger_name] = @bloger_name) ORDER BY [pub_date] DESC"
        UpdateCommand="UPDATE [DE_resource] SET [bloger_name] = @bloger_name, [pub_date] = @pub_date, [file_name] = @file_name, [description] = @description WHERE [resource_id] = @original_resource_id AND [bloger_name] = @original_bloger_name AND [pub_date] = @original_pub_date AND [file_name] = @original_file_name AND [description] = @original_description">
        <DeleteParameters>
            <asp:Parameter Name="original_resource_id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
            <asp:Parameter Name="pub_date" Type="DateTime" />
            <asp:Parameter Name="file_name" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="original_resource_id" Type="Int32" />
            <asp:Parameter Name="original_bloger_name" Type="String" />
            <asp:Parameter Name="original_pub_date" Type="DateTime" />
            <asp:Parameter Name="original_file_name" Type="String" />
            <asp:Parameter Name="original_description" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
            <asp:Parameter Name="pub_date" Type="DateTime" />
            <asp:Parameter Name="file_name" Type="String" />
            <asp:Parameter Name="description" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

