<%@ Page Title="" Language="C#" MasterPageFile="~/Management/SiteManage.Master" AutoEventWireup="true"
    CodeBehind="DeleteRule.aspx.cs" Inherits="BingoWebsiteCollector.Web.Management.DeleteRule" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="right" style="text-align: center; margin-top: 10px;">
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        <asp:Literal ID="ltEdit" runat="server" Text="编辑" Visible="false"></asp:Literal><asp:Literal
                            ID="ltAdd" runat="server" Text="添加"></asp:Literal>删除规则</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <asp:HiddenField ID="hfDeleteRuleId" runat="server" />
                    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="table_list">
                        <tr>
                            <td>
                                <div align="right">
                                    规则名称：</div>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="tbName" runat="server" Width="80" Wrap="False" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div align="right">
                                    优先级（优先级数小的规则最先生效）：</div>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="tbPriority" runat="server" Text="1" Width="80" Wrap="False" />
                                <validation targetid="<%=tbPriority.ClientID%>" targetname="优先级" type="number" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%">
                                <div align="right">
                                    开始字符串 <font color="red">*</font>：</div>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="tbStartWord" runat="server" CausesValidation="True" EnableViewState="False"
                                    TextMode="MultiLine" Width="100%" Wrap="False" />
                                <validation targetid="<%=tbStartWord.ClientID%>" targetname="开始字符串" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div align="right">
                                    结束字符串<font color="red">*</font>：</div>
                            </td>
                            <td>
                                <asp:TextBox ID="tbEndWord" runat="server" TextMode="MultiLine" Width="100%" Wrap="False" />
                                <validation targetid="<%=tbEndWord.ClientID%>" targetname="结束字符串" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div align="right">
                                    删除类型：</div>
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlDeleteType" runat="server">
                                    <asp:ListItem Value="0">删除前面内容</asp:ListItem>
                                    <asp:ListItem Value="1">删除后面内容</asp:ListItem>
                                    <asp:ListItem Value="2">删除中间内容</asp:ListItem>
                                    <asp:ListItem Value="3">删除前后内容</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div align="right">
                                    规则选项：</div>
                            </td>
                            <td align="left">
                                <asp:CheckBox ID="cbIsEnable" CssClass="checkbox" runat="server" Checked="true" Text="是否激活" />
                                <asp:CheckBox ID="cbIncludeStartWord" CssClass="checkbox" runat="server" Text="包含开始字符串" />
                                <asp:CheckBox ID="cbIncludeEndWord" CssClass="checkbox" runat="server" Text="包含结束字符串" />
                                <asp:CheckBox ID="cbCaseSensitive" CssClass="checkbox" runat="server" Text="大小写敏感" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div align="right">
                                    页面匹配：</div>
                            </td>
                            <td align="left">
                                <fieldset>
                                    <legend>指定页面匹配</legend>
                                    <asp:CheckBox ID="cbMatchUrl" CssClass="checkbox" runat="server" onclick="$('#matchUrlParameter').toggle()"
                                        Text="规则用于指定页面（当前规则只对指定的页面生效）" />
                                    <br />
                                    <div id="matchUrlParameter" style="display: <%=cbMatchUrl.Checked?string.Empty:"none"%>">
                                        <asp:CheckBox ID="cbExactMatch" CssClass="checkbox" runat="server" Text="是否精确匹配指定网址（对指定页面地址采取精确匹配或者模糊匹配，模糊匹配只要页面网址包含指定网址【这里是指原网页地址】，则规则生效）" />
                                        <br />
                                        指定地址：
                                        <asp:TextBox ID="tbUrl" runat="server" Width="80%" Wrap="False" />
                                    </div>
                                </fieldset>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Label ID="errorInfo" runat="server" Text="Label"></asp:Label>
                                <asp:LinkButton ID="lbSubmit" runat="server" Text="【提交】" OnClick="lbSubmit_Click"
                                    OnClientClick="return validateForm()" />
                                &nbsp;<asp:LinkButton ID="lbCancel" runat="server" Text="【取消】" OnClick="lbCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div class="clear" style="margin-top: 10px;">
        </div>
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        删除规则列表</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <asp:GridView ID="gvDeleteRules" runat="server" AutoGenerateColumns="False" GridLines="None"
                        CssClass="table_list" Width="100%" EnableModelValidation="True">
                        <Columns>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" Text="【编辑】" CommandArgument='<%# Bind("RuleId") %>'
                                        OnClick="lbEdit_Click"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandArgument='<%# Bind("RuleId") %>'
                                        Text="【删除】" OnClick="lbDelete_Click" OnClientClick="if(confirm('确认删除记录?')){eval(this.attributes['href'].value)}else{return false}"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Priority" HeaderText="优先级" SortExpression="Priority" />
                            <asp:CheckBoxField DataField="IsEnable" HeaderText="是否激活" SortExpression="IsEnable" />
                            <asp:BoundField DataField="Name" HeaderText="规则名称" SortExpression="Name" />
                            <asp:TemplateField HeaderText="开始字符串" SortExpression="StarWord">
                                <ItemTemplate>
                                    <asp:TextBox ID="startWord" runat="server" Text='<%# Bind("StartWord") %>' ReadOnly="true"
                                        TextMode="MultiLine" Width="200px" Wrap="False"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CheckBoxField DataField="IncludeStartWord" HeaderText="包含开始字符串" SortExpression="IncludeStartWord" />
                            <asp:TemplateField HeaderText="结束字符串" SortExpression="EndWord">
                                <ItemTemplate>
                                    <asp:TextBox ID="endWord" runat="server" Text='<%# Bind("EndWord") %>' ReadOnly="true"
                                        TextMode="MultiLine" Width="200px" Wrap="False"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CheckBoxField DataField="IncludeEndWord" HeaderText="包含结束字符串" SortExpression="IncludeEndWord" />
                            <asp:CheckBoxField DataField="CaseSensitive" HeaderText="大小写敏感" SortExpression="CaseSensitive" />
                            <asp:CheckBoxField DataField="MatchUrl" HeaderText="是否指定页面" SortExpression="MatchUrl" />
                            <asp:CheckBoxField DataField="ExactMatch" HeaderText="是否精确匹配地址" SortExpression="ExactMatch" />
                        </Columns>
                        <HeaderStyle CssClass="tr1" />
                        <RowStyle CssClass="tr_a" />
                        <AlternatingRowStyle CssClass="tr_b" />
                        <FooterStyle CssClass="dg_header" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <div class="clear" style="margin-top: 10px;">
        </div>
    </div>
</asp:Content>
