<%@ Page Language="C#" MasterPageFile="~/AdminMasterPage.master" AutoEventWireup="true" CodeFile="BlogManage.aspx.cs" Inherits="Admin_UserManage" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    &nbsp;<table>
        <tr>
            <td align="left" style="width: 88px; height: 21px">
            </td>
            <td align="left" style="width: 100px; height: 21px">
            </td>
        </tr>
        <tr>
            <td align="left" colspan="2" style="height: 20px">
                <asp:Label ID="Label1" runat="server" Height="25px" Text="推荐、禁止、删除博客" Width="204px"></asp:Label><br />
            </td>
        </tr>
        <tr>
            <td align="left" colspan="2" style="height: 3px">
                <hr style="width: 549px" />
            </td>
        </tr>
        <tr>
            <td style="width: 88px">
            </td>
            <td style="width: 100px" align="left">
                &nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    DataKeyNames="bloger_name" DataSourceID="SqlDataSource2" ForeColor="#333333"
                    GridLines="None" Height="107px" Width="483px" OnRowDeleting="GridView1_RowDeleting">
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <Columns>
                        <asp:BoundField DataField="bloger_name" HeaderText="博主账号" ReadOnly="True" SortExpression="bloger_name" />
                        <asp:BoundField DataField="bloger_title" HeaderText="博客名称" ReadOnly="True" SortExpression="bloger_title" />
                        <asp:CheckBoxField DataField="is_top" HeaderText="推荐" SortExpression="is_top" />
                        <asp:CheckBoxField DataField="is_forbid" HeaderText="停用" SortExpression="is_forbid" />
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="更新"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="取消"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="编辑"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                    OnClick="LinkButton2_Click" OnClientClick='return confirm("确认删除？")' Text="删除" OnCommand="LinkButton2_Command"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <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="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DesertEagleConnectionString %>" DeleteCommand="DELETE FROM [DE_bloger] WHERE [bloger_name] = @original_bloger_name"
        InsertCommand="INSERT INTO [DE_bloger] ([bloger_name], [bloger_title], [is_top], [is_forbid]) VALUES (@bloger_name, @bloger_title, @is_top, @is_forbid)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [bloger_name], [bloger_title], [is_top], [is_forbid] FROM [DE_bloger] WHERE ([bloger_enable] = @bloger_enable)"
        UpdateCommand="UPDATE [DE_bloger] SET [is_top] = @is_top, [is_forbid] = @is_forbid WHERE [bloger_name] = @original_bloger_name">
        <DeleteParameters>
            <asp:Parameter Name="original_bloger_name" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="is_top" Type="Boolean" />
            <asp:Parameter Name="is_forbid" Type="Boolean" />
            <asp:Parameter Name="original_bloger_name" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="True" Name="bloger_enable" Type="Boolean" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
            <asp:Parameter Name="bloger_title" Type="String" />
            <asp:Parameter Name="is_top" Type="Boolean" />
            <asp:Parameter Name="is_forbid" Type="Boolean" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

