<%@ Page Language="c#" CodeBehind="SearchList.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Search.SearchList"
    Title="分析-更多查询列表" %>

<%@ Import Namespace="SWTraining" %>
<!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 id="Head1" runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div class="tool_Search">
        <table>
            <td>
                <label class="lab_buttom">
                    <asp:Button ID="btnAdd" runat="server" Text="新建Sql查询" OnClick="btnAdd_Click"></asp:Button>
                </label>
            </td>
            <td>
                <label class="lab_buttom">
                    <asp:Button ID="btnAddPlugIns" runat="server" Text="新建查询插件" OnClick="btnAdd_Click">
                    </asp:Button>
                </label>
            </td>
            <td>
                <asp:ImageButton runat="server" ID="btnOnlinePlugIns" OnClick="btnOnlinePlugIns_Click"
                    ImageUrl="../images/yysc.gif"></asp:ImageButton>
            </td>
        </table>
    </div>
    <div class="both">
    </div>
    <div class="divpanel">
        <asp:GridView runat="server" DataKeyNames="SearchID" CssClass="gridview" ID="GridView1"
            AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated"
            OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                <asp:BoundField DataField="SearchID" HeaderText="ID" ReadOnly="true" />
                <asp:TemplateField HeaderText="标题">
                    <ItemTemplate>
                        <table cellpadding="0" cellspacing="0">
                            <td>
                                <%# ShowSqlIco(Eval("SearchType"),Eval("Source")) %>
                            </td>
                            <td>
                                <asp:HyperLink ID="hlkShow" runat="server" Text='<%#Eval("SearchName")%>' NavigateUrl='<%# string.Format(((int)Eval("SearchType") == 0? "Search": "../PlugIns/PlugIns{0}")+".aspx?SearchID={0}",Eval("SearchID")) %>'
                                    Target="_blank" />
                            </td>
                        </table>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="DateAndTime" HeaderText="时间" DataFormatString="{0:d}" />
                <asp:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <%# Rs.Items.GetLockState((int)Eval("LockState"))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="排序">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnUp" runat="server" CommandName="Up" Text="↑"></asp:LinkButton>
                        <asp:LinkButton ID="btnDo" runat="server" CommandName="Do" Text="↓"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编辑">
                    <ItemTemplate>
                        <asp:HyperLink runat="server" ID="hlkEdit" Text="编辑" NavigateUrl='<%# string.Format("PostSearch"+((int)Eval("SearchType") == 0? "": "PlugIns")+".aspx?SearchID={0}&GetUrl={1}",Eval("SearchID"),swq.Web.PathAndQuery()) %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("SearchType") %>'
                            OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="divpanel">
        <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
    </div>
    </form>
    <div class="divremark">
        <b>注意事项：</b><br />
        1、系统里没有您要的查询，可以点击“应用市场”找找看。<br />
    </div>
</body>
</html>
