<%@ Page Language="c#" CodeBehind="SqlSearch.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Search.SqlSearch"
    Title="SQL语句查询-分析" %>

<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../UserCol/CodeBox.ascx" TagName="CodeBox" TagPrefix="uc1" %>
<!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" />
    <script type="text/javascript">
        var h = 300;
        function AddHeight(num) {
            var div = document.getElementById("tbxSql_div_HtmlBox");
            if (num < 0 && h < 300) {

            } else {
                h += num;
            }

            if (h > 0) {
                div.style.height = h + "px";
            }

            document.getElementById("codeboxheight").value = h;
        }

        function insertHTML(edit, html) {
            edit.focus();
            if (edit != null) {
                var r = edit.document.selection.createRange();
                r.pasteHTML(html);
            }
        }

        function insertText(edit, text) {
            edit.focus();
            if (edit != null) {

                var r = edit.document.selection.createRange();
                r.text = text;
            }
        }
    </script>
    <style type="text/css">
        .width
        {
            width: auto !important;
        }
        .row td
        {
            white-space: nowrap !important;
        }
        .row th
        {
            white-space: nowrap !important;
        }
        
        th
        {
            padding-left: 3px !important;
            padding-right: 3px !important;
        }
    </style>
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div class="divpanel">
        <table cellspacing="0" cellpadding="0" align="center" border="0" style="width: 65%">
            <tr>
                <td align="left" style="height: 24px">
                    <label class="lab_button">
                        <input id="btnAddHeight" onclick="AddHeight(50);" title="加高编辑器" type="button" value="+" /></label>
                    <label class="lab_button">
                        <input id="btnClearHeight" onclick="AddHeight(-50);" title="减高编辑器" type="button"
                            value="-" /></label>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <uc1:CodeBox ID="tbxSql" runat="server" Width="100%" Height="220px" />
                </td>
            </tr>
            <tr>
                <td align="center" style="height: 24px">
                    <div class="tool_Search" style="float: none; width: 250px">
                        <asp:CheckBox ID="cbxExcel" runat="server" Text="导出"></asp:CheckBox>
                        <label class="lab_button">
                            <asp:Button ID="btnSelect" runat="server" Text="查询" OnClick="btnSelect_Click"></asp:Button>
                        </label>
                        &nbsp;<asp:ImageButton ID="ibnSMS" runat="server" ImageUrl='<%# accTheme("tools/sms.gif") %>'
                            OnClick="ibnSMS_Click" Style="height: 14px" Height="16px" />
                        &nbsp;<asp:ImageButton ID="ibnHighSMS" runat="server" ImageUrl='<%# accTheme("tools/highsms.gif") %>'
                            OnClick="ibnHighSMS_Click" />
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="divpanel">
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" CssClass="smallgridview width"
            OnSorting="GridView1_Sorting" EnableViewState="False">
            <RowStyle CssClass="row" Wrap="False" />
            <HeaderStyle CssClass="row" Wrap="false" />
        </asp:GridView>
    </div>
    <div class="divpanel">
        <asp:Label ID="labMsg" runat="server" ForeColor="Red" EnableViewState="False"></asp:Label>
    </div>
    <input id="codeboxheight" name="codeboxheight" type="hidden" value="300" />
    </form>
</body>
</html>
