<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_LabelSqlBuild, WebApp_deploy" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<style type="text/css">
    .label_square{width:100px;height:30px;line-height:30px;border:solid 1px #449AE8;background:#E0EEF5;text-align:center;margin:5px;float:left;cursor: pointer;}
    .drag_lablestyle{width:100px;height:30px;line-height:30px;border:solid 1px #449AE8;background:#E0EEFE;text-align:center;margin:5px;float:left;}
</style>

<script type="text/javascript">
<!--
var dragspan;
var src;

function dragstart()
{
    window.drag = 1;
    window.event.returnValue = false;
    
    dragspan = document.createElement('div');
    dragspan.style.position = "absolute";
    dragspan.className = "drag_lablestyle";
    var mousePos = mouseCoords(window.event);
    dragspan.style.left = mousePos.x + 10;
    dragspan.style.top = mousePos.y + 8;
            
    dragspan.appendChild(document.createTextNode(window.event.srcElement.innerText));
    src = window.event.srcElement.innerText;

    document.body.appendChild(dragspan);
}

function dragend(type)
{
    if(window.drag)
    {
        document.body.removeChild(dragspan);
        var target = window.event.srcElement;
        if(type == 1)
        {
            target.focus();
            var tarobj = document.selection.createRange();
            tarobj.text = "@" + src;
        }
        else
        {
            target.value = "@" + src;
        }
        window.drag = 0;
        window.event.returnValue = true;
    }
    
}

function dragmove()
{
    if(window.drag)
    {
        var ev = ev || window.event;
        var mousePos = mouseCoords(ev);

        ev.returnValue = false;
                 
        dragspan.style.left = mousePos.x + 10;
        dragspan.style.top = mousePos.y + 8;
    }
}

function dragclear()
{
    if(window.drag)
    {
        document.body.removeChild(dragspan);
        window.drag = 0;
        window.event.returnValue = true;
    }
    
}
   
function mouseCoords(ev) {
    if(ev.pageX || ev.pageY) {
      return {x:ev.pageX, y:ev.pageY};
    }
    return {
      x:ev.clientX + document.documentElement.scrollLeft - document.body.clientLeft,
      y:ev.clientY + document.documentElement.scrollTop - document.body.clientTop
    };
}

function movePoint() 
{
    if(window.drag)
    {
        var rng = event.srcElement.createTextRange(); 
        rng.moveToPoint(event.x,event.y); 
        rng.select(); 
    }
}
function showHideCountPage()
{
   var obj=document.getElementById("showCount");
   var usepage = document.getElementById("ctl00_ContentPlaceHolder1_UsePage");
   if(usepage.checked==true)
   {
      obj.style.display="none";
   }
   else
   {
      obj.style.display="none";
   }
}
-->
    </script>
    
<table class="adminheading">                       
   <tr>
      <th>标签管理</th> 
      <td align="right"><div style="width:50px"><a href="Admin_Lable.aspx">返回</a></div></td>
      <td class="rtdw"></td>
   </tr>                        
</table> 

   <table class="nick" cellpadding="1" cellspacing="1" onmouseup="dragclear()" onmousemove="dragmove()">
       <tr><td class="tit" colspan="2">标签查询设置</td></tr>
       <tr>
           <th>输出数量</th>
           <td class="rtd"><asp:TextBox ID="OutPutNums" runat="server"  Text="10"/></td>
       </tr>
       <tr>
           <th>选择数据</th>
           <td class="rtd">
               <table width="80%" style="text-align:right;">
                  <tr>
                     <td width="150px">主表：</td><td><asp:DropDownList ID="MainSheet" runat="server" Width="200px"  OnSelectedIndexChanged="MainSheet_SelectIndexChanged" AutoPostBack="true"/></td>
                     <td width="150px">从表：</td><td><asp:DropDownList ID="SecondSheet" runat="server" Width="200px" OnSelectedIndexChanged="SecondSheet_SelectIndexChanged" AutoPostBack="true"/></td>
                  </tr>
                  <tr>
                     <td>输出字段：</td><td><asp:ListBox ID="MainList" runat="server" SelectionMode="Multiple" Width="200px" Height="250px"  /></td>
                     <td>输出字段：</td><td><asp:ListBox ID="SecondList" runat="server" SelectionMode="Multiple" Width="200px" Height="250px"/></td>
                  </tr>
               </table>
               
           </td>
       </tr>
       <tr id="linkCondition" runat="server" visible="false">
           <th>约束条件</th>
           <td class="rtd">
              <asp:DropDownList ID="JoinList" runat="server">
                 <asp:ListItem>Inner Join</asp:ListItem>
                 <asp:ListItem>Left Join</asp:ListItem>
                 <asp:ListItem>Right Join</asp:ListItem>
                 <asp:ListItem>Outer Join</asp:ListItem>
              </asp:DropDownList>
              <asp:DropDownList ID="MainList_Join" runat=server />
              <asp:DropDownList ID="JoinLink" runat="server">
                  <asp:ListItem>=</asp:ListItem>
                   <asp:ListItem>like</asp:ListItem>
              </asp:DropDownList>
              <asp:DropDownList ID="SecondList_Join" runat="server" />
          </td>
       </tr>
       <tr>
           <th><asp:button runat="server" Text="生成查询条件"  ID="CreateSQLSearchButton" OnClick="CreateSQLSearchButton_Click"/></th>
           <td class="rtd">
              <div style="width:80%; text-align:center;">
                   <asp:PlaceHolder ID="CreateSQLSearch" runat="server"  />
              </div> 
              
             
           </td>
       </tr>
       <tr>
           <th>自定义参数</th>
           <td class="rtd"><asp:Literal ID="parmlist" runat="server" /></td>
       </tr>
       <tr>
           <th><asp:Button ID="BuildSQl_Button" runat="server" Text="生成SQL语句"  OnClick="BuildSQl_Button_Click"/></th>
           <td class="rtd"><asp:TextBox ID="SqlContent" TextMode="MultiLine" Height="100px" Width="90%" runat="server" CssClass="TextBoxStyle" /></td>
       </tr>
       <tr>
           <th><asp:CheckBox ID="UsePage" runat="server"  />启用分页</th>
           <td class="rtd"><div id="showCount" style="display:none;"><asp:TextBox ID="CountPage" runat="server" TextMode="MultiLine" Height="50px" Width="90%" CssClass="TextBoxStyle" /></div></td>
       </tr>
       </table>
       <div class="div_btm">
              <asp:Button ID="PreStepButton" runat="server" Text="上一步"  OnClick="PreStepButton_Click" />&nbsp;&nbsp;
              <asp:Button ID="NextStepButton" runat="server" Text="下一步" OnClick="NextStepButton_Click" />&nbsp;
              <asp:Button ID="SaveButton" runat="server" Text="保　存"   OnClick="SaveButton_Click" Visible="false"/>&nbsp;
              <input type="button" value="取　消" onclick="location.href='Admin_Lable.aspx'" />
       </div>
   
   <asp:HiddenField ID="H_flag" runat="server" />

</asp:Content>

