<%@ Page Language="C#" MasterPageFile="~/BlogerMasterPage.master" AutoEventWireup="true" CodeFile="LogManage.aspx.cs" Inherits="Bloger_LogManage_LogManage" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
// <!CDATA[

function HR1_onclick() {

}

// ]]>
</script>

    &nbsp;<table style="width: 566px; height: 149px">
        <tr>
            <td align="right" style="width: 91px">
                <asp:Label ID="Label3" runat="server" Text="日志管理"></asp:Label></td>
            <td style="width: 100px">
            </td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td align="right" colspan="3" style="height: 2px">
                <hr class="width85" id="HR1" onclick="return HR1_onclick()"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 91px; height: 21px">
            </td>
            <td style="width: 100px; height: 21px">
                &nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="log_id"
                    DataSourceID="SqlDataSource1" Height="10px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                    OnSelectedIndexChanging="GridView1_SelectedIndexChanging" Width="403px" AllowPaging="True" PageSize="8">
                    <Columns>
                        <asp:TemplateField HeaderText="log_id" InsertVisible="False" SortExpression="log_id"
                            Visible="False">
                            <EditItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("log_id") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("log_id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="log_title" HeaderText="log_title" SortExpression="log_title" />
                        <asp:BoundField DataField="pub_date" HeaderText="pub_date" SortExpression="pub_date" />
                        <asp:BoundField DataField="click_count" HeaderText="click_count" SortExpression="click_count" />
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
                                    Text="编辑" OnClick="LinkButton1_Click"></asp:LinkButton><asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
                                        CommandName="Delete" OnClientClick='return confirm("确认删除？")' Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
            <td style="width: 100px; height: 21px">
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 91px; height: 21px">
            </td>
            <td style="width: 100px; height: 21px">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
                    ConnectionString="<%$ ConnectionStrings:DesertEagleConnectionString %>" DeleteCommand="DELETE FROM [DE_logs] WHERE [log_id] = @original_log_id"
                    InsertCommand="INSERT INTO [DE_logs] ([log_title], [contents], [pub_date], [category_id], [bloger_name], [click_count], [is_hide]) VALUES (@log_title, @contents, @pub_date, @category_id, @bloger_name, @click_count, @is_hide)"
                    OldValuesParameterFormatString="original_{0}" OnSelecting="SqlDataSource1_Selecting"
                    SelectCommand="SELECT * FROM [DE_logs] WHERE ([bloger_name] = @bloger_name)"
                    UpdateCommand="UPDATE [DE_logs] SET [log_title] = @log_title, [contents] = @contents, [pub_date] = @pub_date, [category_id] = @category_id, [bloger_name] = @bloger_name, [click_count] = @click_count, [is_hide] = @is_hide WHERE [log_id] = @original_log_id AND [log_title] = @original_log_title AND [contents] = @original_contents AND [pub_date] = @original_pub_date AND [category_id] = @original_category_id AND [bloger_name] = @original_bloger_name AND [click_count] = @original_click_count AND [is_hide] = @original_is_hide">
                    <DeleteParameters>
                        <asp:Parameter Name="original_log_id" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="log_title" Type="String" />
                        <asp:Parameter Name="contents" Type="String" />
                        <asp:Parameter Name="pub_date" Type="DateTime" />
                        <asp:Parameter Name="category_id" Type="Int32" />
                        <asp:Parameter Name="bloger_name" Type="String" />
                        <asp:Parameter Name="click_count" Type="Int32" />
                        <asp:Parameter Name="is_hide" Type="Boolean" />
                        <asp:Parameter Name="original_log_id" Type="Int32" />
                        <asp:Parameter Name="original_log_title" Type="String" />
                        <asp:Parameter Name="original_contents" Type="String" />
                        <asp:Parameter Name="original_pub_date" Type="DateTime" />
                        <asp:Parameter Name="original_category_id" Type="Int32" />
                        <asp:Parameter Name="original_bloger_name" Type="String" />
                        <asp:Parameter Name="original_click_count" Type="Int32" />
                        <asp:Parameter Name="original_is_hide" Type="Boolean" />
                    </UpdateParameters>
                    <SelectParameters>
                        <asp:Parameter Name="bloger_name" Type="String" />
                    </SelectParameters>
                    <InsertParameters>
                        <asp:Parameter Name="log_title" Type="String" />
                        <asp:Parameter Name="contents" Type="String" />
                        <asp:Parameter Name="pub_date" Type="DateTime" />
                        <asp:Parameter Name="category_id" Type="Int32" />
                        <asp:Parameter Name="bloger_name" Type="String" />
                        <asp:Parameter Name="click_count" Type="Int32" />
                        <asp:Parameter Name="is_hide" Type="Boolean" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
            <td style="width: 100px; height: 21px">
            </td>
        </tr>
    </table>
</asp:Content>

