<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    Codebehind="AutoCreateHtml.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.Contents.AutoCreateHtml"
    Title="自动生成配置" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="server">
    <pe:ExtendedSiteMapPath ID="SmpNavigator" SiteMapProvider="AdminMapProvider" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="server">
    <table width="100%" cellpadding="2" cellspacing="1" class="border">
        <tr align="center">
            <td colspan="2" class="spacingtitle">
                自动生成配置
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" style="width: 40%; ">
                <strong>自动生成状态：</strong>
            </td>
            <td>
                <asp:Label ID="LblAutoCreateStatus" runat="server" Text="" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" align="left">
                <strong>开启自动生成：</strong>
            </td>
            <td>
                <asp:DropDownList ID="DropIsEnable"  runat="server">
                    <asp:ListItem Text="启用" Value="True"></asp:ListItem>
                    <asp:ListItem Text="停用" Value="False" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>每次自动生成的篇数：</strong>
            </td>
            <td>
                <pe:NumericBox ID="TxtNumber" runat="server" Width="80"></pe:NumericBox>篇
                <pe:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TxtNumber"
                    runat="server" ErrorMessage="请填写每次自动生成的篇数！" SetFocusOnError="true" Display="Dynamic" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>选择栏目：</strong>
                <br />
                <br />
                如果不选，则从所有信息中生成最新未生成的指定信息数。
                <br />
                如果选择，则只生成所选栏目的最新未生成的指定信息数。
                <br />
                按住“Ctrl”或“Shift”键可以多选，按住“Ctrl”可取消选择。
            </td>
            <td>
                <asp:CheckBox ID="ChkCateogry" runat="server" />同时自动生成选中的栏目页<br />
                <br />
                <asp:ListBox ID="LstNodes" runat="server" Width="200px" Height="200px" SelectionMode="Multiple"
                    DataTextField="NodeName" DataValueField="NodeId" ToolTip="按住“Ctrl”或“Shift”键可以多选，按住“Ctrl”可取消选择" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否自动生成网站首页：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="RadLIndexPage" RepeatDirection="horizontal" runat="server">
                    <asp:ListItem Value="True" Selected="true">是</asp:ListItem>
                    <asp:ListItem Value="False">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" align="left">
                <strong>索引时间类型：</strong>
            </td>
            <td>
                <asp:RadioButton ID="RadTimingType" runat="server" GroupName="TimingType" Text="每天" />
                <asp:RadioButton ID="RadTimingType2" runat="server" GroupName="TimingType" Text="每周" />
                <asp:RadioButton ID="RadTimingType3" runat="server" GroupName="TimingType" Text="每月"/>
                <asp:RadioButton ID="RadTimingType4" runat="server" GroupName="TimingType" Text="自定义Cron表达式"/>
            </td>
        </tr>
        <tr class="tdbg" id="TimingType1" style="display: none;">
            <td class="tdbgleft" align="left">
                <strong>每周：</strong>
            </td>
            <td>
                <asp:DropDownList ID="DropWeeks" runat="server">
                    <asp:ListItem Value="2">周一</asp:ListItem>
                    <asp:ListItem Value="3">周二</asp:ListItem>
                    <asp:ListItem Value="4">周三</asp:ListItem>
                    <asp:ListItem Value="5">周四</asp:ListItem>
                    <asp:ListItem Value="6">周五</asp:ListItem>
                    <asp:ListItem Value="7">周六</asp:ListItem>
                    <asp:ListItem Value="1">周日</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr class="tdbg" id="TimingType2" style="display: none;">
            <td class="tdbgleft" align="left">
                <strong>每月：</strong>
            </td>
            <td>
                <asp:TextBox ID="TextDay" runat="server" Text="15" Width="30" />天
            </td>
        </tr>
        <tr class="tdbg" id="TimingType3" style="display: none;">
            <td class="tdbgleft" align="left">
                <strong>定时时间：</strong>
            </td>
            <td>
                <asp:TextBox ID="TxtHour" runat="server" Text="24" Width="30" />时<asp:TextBox ID="TxtMinute" runat="server" Text="0" Width="30" />分
            </td>
        </tr>
        <tr class="tdbg" id="TimingType4" style="display: none;">
            <td class="tdbgleft" align="left">
                <strong>Cron表达式：</strong>
            </td>
            <td>
                <asp:TextBox ID="TxtCron" runat="server" Text="0 0/1 * * * ?" /><br />
                <span style="color: Green">注：索引最终会根据Cron表达式定期索引，如果有个性化时间需求，请设置Cron表达式。<br />Cron表达式详细配置教程请参见 <a href="http://www.powereasy.net/go.aspx?uid=10101" target="_blank"><span style="color:Orange">Quartz的Cron表达式配置指南</span></a> </span>
            </td>
        </tr>
        <tr class="tdbgbottom">
            <td colspan="2">
                <asp:Button ID="BtnSave" runat="server" Text="保存配置" OnClick="BtnSave_Click" />
                <asp:Button Text="启动自动生成" runat="server" ID="BtnStartAutoCreate" OnClick="BtnStartAutoCreate_Click" />
            </td>
        </tr>
    </table>
    <script language="javascript" type="text/javascript">
    <!--
        function TimingType(type) {
            switch (type) {
                case 1:
                    document.getElementById("TimingType1").style.display = "none";
                    document.getElementById("TimingType2").style.display = "none";
                    document.getElementById("TimingType4").style.display = "none";
                    document.getElementById("TimingType3").style.display = "";
                    break;
                case 2:
                    document.getElementById("TimingType1").style.display = "";
                    document.getElementById("TimingType3").style.display = "";
                    document.getElementById("TimingType2").style.display = "none";
                    document.getElementById("TimingType4").style.display = "none";
                    break;
                case 3:
                    document.getElementById("TimingType1").style.display = "none";
                    document.getElementById("TimingType2").style.display = "";
                    document.getElementById("TimingType3").style.display = "";
                    document.getElementById("TimingType4").style.display = "none";
                    break;
                default:
                    document.getElementById("TimingType1").style.display = "none";
                    document.getElementById("TimingType2").style.display = "none";
                    document.getElementById("TimingType3").style.display = "none";
                    document.getElementById("TimingType4").style.display = "";
                    break;
            }
        }
        //-->
    </script>
    <br />
    <div id="prompt-note">
        <dl>
        <dt class="prompt-note-tit">
        <span>提示说明</span>
        </dt>
            <dd class="prompt-note-con" style="display: block;">
              <span>注意：修改定时生成时间时，需保存后，再重新启动自动生成。</span>
            </dd>  
        </dl>
    </div>
</asp:Content>
