<%@ page language="C#" autoeventwireup="true" inherits="admin_model_Search, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Import Namespace="D.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />

    <script src="../../js/Common.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../js/Dragdrop.js"></script>

    <script src="../../js/lhgdialog/lhgcore.lhgdialog.min.js?self=true&skin=<%=Function.GetCssNameColor()%>" type="text/javascript"></script>

    <script type="text/javascript">
        function Show(obj) {
            var TypeCount = document.getElementsByName(obj.id);
            var p = 0;
            if (navigator.appName == "Microsoft Internet Explorer") {
                p = 1;
            }
            for (var i = p; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    if (TypeCount[i].value == "DataList") {
                        DianCMS_$("DivDataList").style.display = "";
                        DianCMS_$("txtTemplate").value = "/系统模板/查询结果页_多列.html";
                    }
                    else {
                        DianCMS_$("DivDataList").style.display = "none";
                        DianCMS_$("txtTemplate").value = "/系统模板/查询结果页_单列.html";
                    }
                }
            }
        }

        function Method(obj) {
            var TypeCount = document.getElementsByName(obj.id);
            if (TypeCount[2].checked) {
                DianCMS_$("method").innerHTML = "get";
            }
            else {
                DianCMS_$("method").innerHTML = "post";
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server" onkeydown="Save()">
    <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td>
                <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                您现在的位置：<a href="../info.aspx">后台管理</a> >> <a href="SearchList.aspx
">管理查询</a> >> 设置查询
            </td>
        </tr>
    </table>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table class="border" cellspacing="1" cellpadding="0" border="0" align="center">
                <tr>
                    <td class="bqleft">
                        查询名称：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtName" runat="server" CssClass="in1" Columns="40"></asp:TextBox><font color="#ff0066">*</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        指定模型/表单：
                    </td>
                    <td class="bqright">
                        <asp:DropDownList ID="dropModelName" runat="server" AutoPostBack="True" OnSelectedIndexChanged="dropModelName_SelectedIndexChanged">
                            <asp:ListItem Value="0">选择模型/表单</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr style="display: none">
                    <td class="bqleft">
                        提交方式：
                    </td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="Radmethod" runat="server" RepeatDirection="Horizontal" onclick="Method(this)">
                            <asp:ListItem Value="post">post</asp:ListItem>
                            <asp:ListItem Value="get" Selected="True">get</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        选择字段：
                    </td>
                    <td class="bqright">
                        <asp:DataList ID="DataList2" runat="server" RepeatColumns="6" RepeatDirection="Horizontal"
                            Width="100%">
                            <ItemStyle Width="13%" />
                            <ItemTemplate>
                                <div onclick="CreateRange('txtFormHtml','{D_F_<%# Eval("Name") %>}')" class="fieldstyle" title="点击选择该字段到搜索样式">
                                    <%# Eval("Alias")%>
                                </div>
                            </ItemTemplate>
                        </asp:DataList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        备用代码：
                    </td>
                    <td class="bqright">
                        <input id="Button11" type="button" value="<table>" class="btn" onclick="Win_Open('../common/table.aspx?Control=txtFormHtml','','550','415')" />
                        <input id="Button12" type="button" value="<tr></tr>" class="btn" onclick="CreateRange('txtFormHtml','<tr></tr>')" />
                        <input id="Button13" type="button" value="<td></td>" class="btn" onclick="CreateRange('txtFormHtml','<td></td>')" />
                        <input id="Button14" type="button" value="<div>" class="btn" onclick="Win_Open('../common/div.aspx?Control=txtFormHtml','','550','150')" />
                        <input id="Button15" type="button" value="提交按钮" class="btn" onclick="CreateRange('txtFormHtml','<input type=&quot;submit&quot; value=&quot; 提交 &quot; />')" />
                        <input id="Button16" type="button" value="重置按钮" class="btn" onclick="CreateRange('txtFormHtml','<input type=&quot;reset&quot; value=&quot; 重置 &quot; />')" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        提交表单样式：
                    </td>
                    <td class="bqright">
                        <font color="#a31515">&lt;form name="form1" method="<span id="method" runat="server">get</span>"
                            action=""&gt;</font>
                        <asp:TextBox ID="txtFormHtml" runat="server" TextMode="MultiLine" Style="width: 99%"
                            Rows="10"></asp:TextBox>
                        <font color="#a31515">&lt;/form&gt;</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        文件生成路径：
                    </td>
                    <td class="bqright">
                        <asp:Literal ID="LitParam" runat="server"></asp:Literal><asp:TextBox ID="txtFilePath"
                            runat="server" CssClass="in1" Text="search/"></asp:TextBox><font color="#ff0066">*</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        生成文件名称：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtFileName" runat="server" CssClass="in1"></asp:TextBox>.aspx<font
                            color="#ff0066">*</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        查询后布局方式：
                    </td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="RadLayout" runat="server" RepeatDirection="Horizontal" onclick="Show(this)">
                            <asp:ListItem Value="Repeater" Selected="True">多行单列</asp:ListItem>
                            <asp:ListItem Value="DataList">多行多列</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        查询后显示模板：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtTemplate" runat="server" Columns="40" CssClass="in1" Style="float: left"></asp:TextBox>
                        <input id="Button9" type="button" value="选择模板" class="btn" onclick="WinOpenLhgDialog('选择模板','../template/SelectTemplate.aspx?ControlId=txtTemplate',650,450,'')"  Style="float: left"/><font
                            color="#ff0066">*</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        分页效果：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtCssName" runat="server" CssClass="in1" Columns="20" Text="viciao" Style="float: left"></asp:TextBox><input
                            id="ButCssName" type="button" value="选择分页效果" class="btn" Style="float: left" onclick="WinOpenLhgDialog('选择分页样式', '../common/SelectPageStyle.aspx?ControlId=txtCssName', 500, 300, '')"
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        自定义分页效果：
                    </td>
                    <td class="bqright"><asp:DropDownList ID="DropPager" runat="server">
                                <asp:ListItem Value="0">不使用</asp:ListItem>
                            </asp:DropDownList> 选择后，上面分页效果无效，同时需要在查询模板中引入您自定义分页样式
                    </td>
                </tr>
                <tbody style="display: none" id="DivDataList" runat="server">
                    <tr>
                        <td class="bqleft">
                            显示列数：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtColumn" runat="server" CssClass="in1" Rows="30" Text="1" Columns="10"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            项的布局方向：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadDirection" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="Horizontal" Selected="True">横向</asp:ListItem>
                                <asp:ListItem Value="Vertical">纵向</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            查询后标题样式：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtHeaderStyle" runat="server" Columns="20" CssClass="in1"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            查询后循环行样式：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtItemStyle" runat="server" Columns="20" CssClass="in1"></asp:TextBox>
                        </td>
                    </tr>
                </tbody>
                <tr>
                    <td class="bqleft">
                        备用代码：
                    </td>
                    <td class="bqright">
                        <input id="Button1" type="button" value="<table>" class="btn" onclick="Win_Open('../common/table.aspx?Control=txtHeaderHtml','','550','415')" />
                        <input id="Button2" type="button" value="<tr></tr>" class="btn" onclick="CreateRange('txtHeaderHtml','<tr></tr>')" />
                        <input id="Button3" type="button" value="<td></td>" class="btn" onclick="CreateRange('txtHeaderHtml','<td></td>')" />
                        <input id="Button4" type="button" value="<div>" class="btn" onclick="Win_Open('../common/div.aspx?Control=txtHeaderHtml','','550','150')" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        查询后标题模板：
                    </td>
                    <td class="bqright">
                        <font color="#a31515">&lt;HeaderTemplate&gt;</font>
                        <asp:TextBox ID="txtHeaderHtml" runat="server" TextMode="MultiLine" Style="width: 99%"
                            Rows="8"></asp:TextBox><font color="#a31515">&lt;/HeaderTemplate&gt;</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        选择字段：
                    </td>
                    <td class="bqright">
                        <asp:DataList ID="DataList1" runat="server" RepeatColumns="6" RepeatDirection="Horizontal"
                            Width="100%">
                            <ItemStyle Width="13%" />
                            <ItemTemplate>
                                <div onclick="CreateRange('txtItemHtml','&lt;%# Eval(&quot;<%#Eval("Name") %>&quot;)%&gt;')" class="fieldstyle" title="点击选择该字段到搜索样式"><%# Eval("Alias")%>
                                </div>
                            </ItemTemplate>
                        </asp:DataList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        备用代码：
                    </td>
                    <td class="bqright">
                        <input id="Button5" type="button" value="<table>" class="btn" onclick="Win_Open('../common/table.aspx?Control=txtItemHtml','','550','415')" />
                        <input id="Button6" type="button" value="<tr></tr>" class="btn" onclick="CreateRange('txtItemHtml','<tr></tr>')" />
                        <input id="Button7" type="button" value="<td></td>" class="btn" onclick="CreateRange('txtItemHtml','<td></td>')" />
                        <input id="Button8" type="button" value="<div>" class="btn" onclick="Win_Open('../common/div.aspx?Control=txtItemHtml','','550','150')" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        查询后循环行模板：
                    </td>
                    <td class="bqright">
                        <font color="#a31515">&lt;ItemTemplate&gt;</font>
                        <asp:TextBox ID="txtItemHtml" runat="server" TextMode="MultiLine" Style="width: 99%"
                            Rows="15"></asp:TextBox><font color="#a31515">&lt;/ItemTemplate&gt;</font>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        相应aspx.cs文件：
                    </td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="RadAspxcs" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Selected="True">系统默认</asp:ListItem>
                            <asp:ListItem Value="1">手动输入</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                    </td>
                    <td class="bqright" height="40">
                        <asp:Button ID="DianCMS_Submit" runat="server" Text=" 提交(Ctrl+s) " CssClass="btn radius30 pad_0_30"
                            OnClick="Button10_Click" /><asp:Button ID="Button17" runat="server" Text=" 提交并生成查询文件 "
                                CssClass="btn radius30 pad_0_30" OnClick="Button10_Click" Style="margin-left: 10px" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        可使用函数：
                    </td>
                    <td class="bqright">
                        一、字符截取（GetLength）使用方法：&lt;%# GetLength(Eval("Content","{0}"),300)%&gt;<br />
                        二、内容URL（GetInfoUrl）使用方法：<br />
                        1：内容在模型下URL：&lt;%# GetInfoUrl("0",Eval("Id","{0}"))%&gt;
                        <br />
                        2：内容在某栏目下URL：&lt;%# GetInfoUrl(Eval("Class_Id","{0}"),Eval("Id","{0}"))%&gt; 如：在模型中栏目的字段名称为Column,那么这里就把Class_Id替换成Column_Id即可<br />
                        3：内容在表单下URL：&lt;%# GetInfoUrl(Eval("Id","{0}"))%&gt;<br />
                        三、时间格式化：&lt;%# Eval("AddTime","{0:yyyy-MM-dd}")%&gt;<br />
                        四、无图路径：&lt;%# GetNoImagePath(Eval("ImageText","{0}"))%&gt;,如果ImageText字段有图时，将显示实际图片路径，否则将显示系统默认无图图片。<br />
                        五：图片等比例显示
                        <br />
                        1、等比例宽度:&lt;%# ImageSize(Eval("ImageText","{0}"),"最大宽度","最大高度","w","/upload/article/")%&gt;
                        <br />
                        2、等比例高度:&lt;%# ImageSize(Eval("ImageText","{0}"),"最大宽度","最大高度","h","/upload/article/")%&gt;<br />
                        六：栏目URL：&lt;%# GetColumnUrl(Eval("Class_Id","{0}"))%&gt;
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
