<%@ page language="C#" masterpagefile="~/manage/Main.master" autoeventwireup="true" inherits="manage_Template, App_Web_ch4l_m16" title="模板管理" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" runat="Server">
    <div id="main">
        <asp:UpdatePanel ID="MsgUpdatePanel" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <asp:Label ID="Msg" runat="server" Text="" CssClass="msg" Visible="False" EnableViewState="False"></asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="TempleListUpdatePanel" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <asp:GridView ID="TemplateList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    OnPageIndexChanging="TemplateList_PageIndexChanging" DataKeyNames="value" PageSize="11"
                    CellPadding="0" CssClass="gv" Width="100%" OnRowDataBound="TemplateList_RowDataBound"
                    OnRowCommand="TemplateList_RowCommand">
                    <Columns>
                        <asp:TemplateField FooterText="模板文件夹" HeaderText="模板文件夹">
                            <EditItemTemplate>
                                &nbsp;
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="TemplateFolderLable" runat="server" Text='<%# Bind("value") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="启用的模板">
                            <EditItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" />
                            </EditItemTemplate>
                            <ControlStyle CssClass="checkBox" />
                            <ItemTemplate>
                                <asp:CheckBox ID="TemplateCheckBox" runat="server" Checked='<%# Eval("value").ToString().Trim()==_defaultTemplate %>'
                                    Enabled="False" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="启用模板" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="EnabledBt" runat="server" Text="启用模板" CausesValidation="False" CommandName="TemplateEnabled"
                                    CssClass="inputBt" Enabled='<%# !(Eval("value").ToString().Trim()==_defaultTemplate) %>'
                                    CommandArgument='<%# Eval("value").ToString().Trim() %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="更新模板" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="UpdateBt" runat="server" CommandName="UpdateTemplate" Text="更新模板"
                                    CssClass="inputBt" Enabled='<%# Eval("value").ToString().Trim()==_defaultTemplate %>'
                                    CommandArgument='<%# Eval("value").ToString().Trim() %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="删除模板" ShowHeader="False">
                            <EditItemTemplate>
                                &nbsp;
                            </EditItemTemplate>
                            <ItemTemplate>
                                &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="DeleteTemplate"
                                    Text="删除模板" CssClass="inputBt" Enabled='<%# !(Eval("value").ToString().Trim()==_defaultTemplate) %>'
                                    CommandArgument='<%# Eval("value").ToString().Trim() %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="gvRow" />
                    <EditRowStyle CssClass="gvEditRow" />
                    <PagerStyle CssClass="gvPage" />
                    <HeaderStyle CssClass="gvHeader" />
                    <AlternatingRowStyle CssClass="gvAlternatingRow" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:HiddenField ID="PostMangerName" runat="server" />
        <asp:HiddenField ID="PostPassword" runat="server" />
        &nbsp;
    </div>
</asp:Content>
