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

<%@ Import Namespace="MTCUN" %>
<!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_button">
                        <asp:Button ID="btnAdd" runat="server" Text="新建Sql查询" OnClick="btnAdd_Click"></asp:Button>
                    </label>
                </td>
                <td>
                    <label class="lab_button">
                        <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")%>' onclick='<%# url((int)Eval("SearchType"),Eval("Params").ToString(),(int)Eval("SearchID")) %>' NavigateUrl='#' />
                                </td>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAndTime" HeaderText="时间" DataFormatString="{0:d}" />
                    <asp:TemplateField HeaderText="访问权限">
                        <ItemTemplate>
                            <%# CacheItems.GetGroupAndUsers(Eval("Allow"),Eval("GroupAndUsers"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <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>
                            <div class="lab_button_sub" id="divEdit" runat="server">
                                <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>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("SearchType") %>'
                                    OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                            </div>
                        </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>
