<%@ Page Language="C#" MasterPageFile="~/BlogerMasterPage.master" AutoEventWireup="true" CodeFile="BlogConfig.aspx.cs" Inherits="Bloger_BlogManage_BlogConfig" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    &nbsp;<table style="width: 516px; height: 333px">
        <tr>
            <td style="width: 20px; height: 10px">
            </td>
            <td align="left" style="width: 140px; height: 10px" valign="top">
                <asp:Label ID="Label2" runat="server" Width="299px"></asp:Label></td>
        </tr>
        <tr>
            <td style="width: 20px; height: 28px">
                <asp:Label ID="Label1" runat="server" Height="12px" Text="博客设置" Width="80px"></asp:Label></td>
            <td align="left" style="width: 140px; height: 28px" valign="top">
            </td>
        </tr>
        <tr>
            <td colspan="2" style="height: 1px">
                <hr />
            </td>
        </tr>
        <tr>
            <td style="width: 20px">
            </td>
            <td align="left" style="width: 140px" valign="top">
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="bloger_name" DataSourceID="SqlDataSource1"
        OnDataBound="FormView1_DataBound">
        <EditItemTemplate>
            <table style="width: 441px; height: 117px">
                <tr>
                    <td align="right" style="width: 86px; height: 40px">
                        博客名称：
                    </td>
                    <td align="left" colspan="2" style="height: 40px">
            <asp:TextBox ID="bloger_titleTextBox" runat="server" Text='<%# Bind("bloger_title") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="bloger_titleTextBox"
                            ErrorMessage="博客名称不能为空" Style="position: static" ValidationGroup="tt"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td align="right" style="width: 86px; height: 34px">
                        博客描述：
                    </td>
                    <td align="left" colspan="2" style="height: 34px">
            <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="descriptionTextBox"
                            ErrorMessage="博客描述不能为空" Style="position: static" ValidationGroup="tt"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td align="right" style="width: 86px; height: 34px">
                        所在院系：</td>
                    <td align="left" colspan="2" style="height: 34px">
            <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
                DataTextField="college_name" DataValueField="college_id" SelectedValue='<%# Bind("college_id") %>'>
            </asp:DropDownList></td>
                </tr>
                <tr>
                    <td align="right" style="width: 86px; height: 41px">
                    </td>
                    <td align="left" style="width: 77px; height: 41px">
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                Text="更新" ValidationGroup="tt"></asp:LinkButton></td>
                    <td align="left" style="width: 70px; height: 41px">
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="取消"></asp:LinkButton></td>
                </tr>
                <tr>
                    <td align="right" style="width: 86px; height: 29px">
                    </td>
                    <td align="left" style="width: 77px; height: 29px">
                    </td>
                    <td align="left" style="width: 70px; height: 29px">
                    </td>
                </tr>
            </table>
            &nbsp;<br />
            <br />
            <br />
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues"
                ConnectionString="<%$ ConnectionStrings:DesertEagleConnectionString %>" DeleteCommand="DELETE FROM [DE_college] WHERE [college_id] = @original_college_id AND [college_name] = @original_college_name AND [bloger_count] = @original_bloger_count"
                InsertCommand="INSERT INTO [DE_college] ([college_name], [bloger_count]) VALUES (@college_name, @bloger_count)"
                OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [DE_college]"
                UpdateCommand="UPDATE [DE_college] SET [college_name] = @college_name, [bloger_count] = @bloger_count WHERE [college_id] = @original_college_id AND [college_name] = @original_college_name AND [bloger_count] = @original_bloger_count">
                <DeleteParameters>
                    <asp:Parameter Name="original_college_id" Type="Int32" />
                    <asp:Parameter Name="original_college_name" Type="String" />
                    <asp:Parameter Name="original_bloger_count" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="college_name" Type="String" />
                    <asp:Parameter Name="bloger_count" Type="Int32" />
                    <asp:Parameter Name="original_college_id" Type="Int32" />
                    <asp:Parameter Name="original_college_name" Type="String" />
                    <asp:Parameter Name="original_bloger_count" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="college_name" Type="String" />
                    <asp:Parameter Name="bloger_count" Type="Int32" />
                </InsertParameters>
            </asp:SqlDataSource>
        </EditItemTemplate>
        <InsertItemTemplate>
            bloger_name:
            <asp:TextBox ID="bloger_nameTextBox" runat="server" Text='<%# Bind("bloger_name") %>'>
            </asp:TextBox><br />
            college_id:
            <asp:TextBox ID="college_idTextBox" runat="server" Text='<%# Bind("college_id") %>'>
            </asp:TextBox><br />
            bloger_title:
            <asp:TextBox ID="bloger_titleTextBox" runat="server" Text='<%# Bind("bloger_title") %>'>
            </asp:TextBox><br />
            description:
            <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>'>
            </asp:TextBox><br />
            pub_date:
            <asp:TextBox ID="pub_dateTextBox" runat="server" Text='<%# Bind("pub_date") %>'>
            </asp:TextBox><br />
            click_count:
            <asp:TextBox ID="click_countTextBox" runat="server" Text='<%# Bind("click_count") %>'>
            </asp:TextBox><br />
            bloger_enable:
            <asp:CheckBox ID="bloger_enableCheckBox" runat="server" Checked='<%# Bind("bloger_enable") %>' /><br />
            is_top:
            <asp:CheckBox ID="is_topCheckBox" runat="server" Checked='<%# Bind("is_top") %>' /><br />
            is_forbid:
            <asp:CheckBox ID="is_forbidCheckBox" runat="server" Checked='<%# Bind("is_forbid") %>' /><br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="插入">
            </asp:LinkButton>
            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="取消">
            </asp:LinkButton>
        </InsertItemTemplate>
        <ItemTemplate>
            bloger_name:
            <asp:Label ID="bloger_nameLabel" runat="server" Text='<%# Eval("bloger_name") %>'></asp:Label><br />
            college_id:
            <asp:Label ID="college_idLabel" runat="server" Text='<%# Bind("college_id") %>'></asp:Label><br />
            bloger_title:
            <asp:Label ID="bloger_titleLabel" runat="server" Text='<%# Bind("bloger_title") %>'></asp:Label><br />
            description:
            <asp:Label ID="descriptionLabel" runat="server" Text='<%# Bind("description") %>'></asp:Label><br />
            pub_date:
            <asp:Label ID="pub_dateLabel" runat="server" Text='<%# Bind("pub_date") %>'></asp:Label><br />
            click_count:
            <asp:Label ID="click_countLabel" runat="server" Text='<%# Bind("click_count") %>'></asp:Label><br />
            bloger_enable:
            <asp:CheckBox ID="bloger_enableCheckBox" runat="server" Checked='<%# Bind("bloger_enable") %>'
                Enabled="false" /><br />
            is_top:
            <asp:CheckBox ID="is_topCheckBox" runat="server" Checked='<%# Bind("is_top") %>'
                Enabled="false" /><br />
            is_forbid:
            <asp:CheckBox ID="is_forbidCheckBox" runat="server" Checked='<%# Bind("is_forbid") %>'
                Enabled="false" /><br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                Text="编辑"></asp:LinkButton>
            <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                Text="删除"></asp:LinkButton>
            <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                Text="新建"></asp:LinkButton>
        </ItemTemplate>
    </asp:FormView>
            </td>
        </tr>
    </table>
    &nbsp;
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DesertEagleConnectionString %>" DeleteCommand="DELETE FROM [DE_bloger] WHERE [bloger_name] = @original_bloger_name AND [college_id] = @original_college_id AND [bloger_title] = @original_bloger_title AND [description] = @original_description AND [pub_date] = @original_pub_date AND [click_count] = @original_click_count AND [bloger_enable] = @original_bloger_enable AND [is_top] = @original_is_top AND [is_forbid] = @original_is_forbid"
        InsertCommand="INSERT INTO [DE_bloger] ([bloger_name], [college_id], [bloger_title], [description], [pub_date], [click_count], [bloger_enable], [is_top], [is_forbid]) VALUES (@bloger_name, @college_id, @bloger_title, @description, @pub_date, @click_count, @bloger_enable, @is_top, @is_forbid)"
        OldValuesParameterFormatString="original_{0}" OnInserting="SqlDataSource1_Inserting"
        OnSelecting="SqlDataSource1_Selecting1" SelectCommand="SELECT * FROM [DE_bloger] WHERE ([bloger_name] = @bloger_name)"
        UpdateCommand="UPDATE [DE_bloger] SET [college_id] = @college_id, [bloger_title] = @bloger_title, [description] = @description WHERE [bloger_name] = @original_bloger_name">
        <DeleteParameters>
            <asp:Parameter Name="original_bloger_name" Type="String" />
            <asp:Parameter Name="original_college_id" Type="Int32" />
            <asp:Parameter Name="original_bloger_title" Type="String" />
            <asp:Parameter Name="original_description" Type="String" />
            <asp:Parameter Name="original_pub_date" Type="DateTime" />
            <asp:Parameter Name="original_click_count" Type="Int32" />
            <asp:Parameter Name="original_bloger_enable" Type="Boolean" />
            <asp:Parameter Name="original_is_top" Type="Boolean" />
            <asp:Parameter Name="original_is_forbid" Type="Boolean" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="college_id" Type="Int32" />
            <asp:Parameter Name="bloger_title" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="original_bloger_name" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="bloger_name" Type="String" />
            <asp:Parameter Name="college_id" Type="Int32" />
            <asp:Parameter Name="bloger_title" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="pub_date" Type="DateTime" />
            <asp:Parameter Name="click_count" Type="Int32" />
            <asp:Parameter Name="bloger_enable" Type="Boolean" />
            <asp:Parameter Name="is_top" Type="Boolean" />
            <asp:Parameter Name="is_forbid" Type="Boolean" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

