main.aspx

来自「基于vs2.0开发的WEB管理SQL功能该软件是一个用于管理SQL Server」· ASPX 代码 · 共 232 行

ASPX
232
字号
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="isqlweb.Main" %>

<!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>Web版 SQL管理器 v1.0 (包函企业管理器与查询分析器部分功能)</title>
    <link href="Style/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form runat="server" id="form1">
<script type="text/javascript" src="Style/jquery.js"></script>
<script type="text/javascript">
	var left1,left2,right1,mf,objectList;
	$(function(){
		left1=$("#left1");
		left2=$("#left2");
		right1=$("#right1");
		mf=$("#mf");
		left1.hide();
		
		objectList=$("#objectList");
		loadObjectList("database");
	});
	function changeLeftPanel(){
		left1.toggle();
		left2.toggle();
	}
	function logout(){
		if(confirm("是否退出?")){
			top.location="login.aspx";
		}
	}
	function gotoHelp(){
		mf.attr("src","about.aspx");
	}
	function gotoSqlexec(){
		mf.attr("src","sqlexec.aspx");
	}
	document.onkeydown = function(){
		if(event.keyCode==116){
			event.keyCode=0; 
			event.returnValue=false; 
		}
	}
	function loadObjectList(type,path){
	    objectList.empty();
	    objectList.text("正在加载...");
	    
	    var name;
	    if(type=="database"){ //加载数据库
	        objectList.load("objectList_ajax.aspx",{cmd:"loadAllDatabases"});
	    }else if(type=="subkind"){ //加载子分类
	        objectList.load("objectList_ajax.aspx",{cmd:"loadSubKind",text:path});
	    }else if(type=="subkind_sub"){
	        name=path.split('/');
	        loadObjectList(name[1],path);
	    }else if(type=="table"){ //加载用户表
	        objectList.load("objectList_ajax.aspx",{cmd:"loadTable",text:path});
	    }else if(type=="view"){ //加载视图
	        objectList.load("objectList_ajax.aspx",{cmd:"loadView",text:path});
	    }else if(type=="procedure"){ //加载存储过程
	        objectList.load("objectList_ajax.aspx",{cmd:"loadProcedure",text:path});
	    }else if(type=="function"){ //加载函数
	        objectList.load("objectList_ajax.aspx",{cmd:"loadFunction",text:path});
	    }else if(type=="trigger"){ //加载触发器
	        objectList.load("objectList_ajax.aspx",{cmd:"loadTrigger",text:path});
	    }else if(type=="column"){ //加载列
	        objectList.load("objectList_ajax.aspx",{cmd:"loadColumn",text:path});
	    }
	    
	    return false;
	}
	
	
	//执行 sp_helptext
	function helptext(name,dbname,tryCount){
	    
	    //打开SQL编辑器
	    if(!tryCount)tryCount=1;
	    
	    if(tryCount==1){
	        if(mf.attr("src")!="sqlexec.aspx"){
	            mf.attr("src","sqlexec.aspx")
	        }
	    }
	    
	    var w;
        try{
            w=mf[0].contentWindow;
        }catch(e){}
        
	    if(w==null || w.helptext==null){
	        if(tryCount>3){ //3秒超时
	            alert("未能及时打开SQL编辑器,请重试!");
	            return false;
	        }
	        setTimeout("helptext('" + name + "','" + dbname + "'," + (tryCount+1) + ")",1000); 
	        return false;
	    }
	    //打开SQL编辑器_end
	    
	    w.helptext(name,dbname);
	    return false;
	}
	
	//添加表
	function addTable(dbname){
	    mf.attr("src","TableAdd.aspx?dbname=" + dbname);
	    return false;
	}
	
	//编辑表
	function editTable(name,dbname){
	    mf.attr("src","TableEdit.aspx?dbname=" + dbname + "&tablename="+escape(name));
        return false;
	}
</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="29" valign="top" id="left1"><table width="29" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="Style/sqlvtools_01.gif" width="29" height="7" alt="" /></td>
      </tr>
      <tr>
        <td bgcolor="#D4D0C8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="1" style="background-color:#808080"></td>
              <td width="26" height="260" valign="top"><button class="sqltoolvbtn"  onclick="changeLeftPanel();"><img src="Style/sqltools_13.gif" alt="" width="16" height="15" align="middle"/></button>
                <button class="sqltoolvbtn" onclick="logout();"><img src="Style/sqltools_03.gif" alt="" width="16" height="15" align="middle" /></button></td>
              <td width="2" background="Style/sqlvtools_04.gif"></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="1" style="background-color:#808080"></td>
      </tr>
    </table></td>
    <td id="left2" width="260" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="8" height="29"><img src="Style/sqltools_01.gif" width="8" height="29" alt="" /></td>
              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="2" background="Style/sqltools_02.gif"></td>
                  </tr>
                  <tr>
                    <td height="26" bgcolor="#D4D0C8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="left">&nbsp;
                              <button class="sqltoolbtn" onclick="changeLeftPanel();"><img src="Style/sqltools_13.gif" alt="" width="16" height="15" align="middle" /></button>
                              <button class="sqltoolbtn" onclick="gotoSqlexec();"><img src="Style/sqltools_11.gif" alt="" width="16" height="15" align="middle" /></button>
                              <button class="sqltoolbtn" onclick="gotoHelp();"><img src="Style/btnhelp.gif" alt="" width="16" height="15" align="middle" /></button>
                              <button class="sqltoolbtn" onclick="logout();"><img src="Style/sqltools_03.gif" alt="" width="16" height="15" align="middle" /></button></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="1" style="background-color:#808080;"></td>
                  </tr>
              </table></td>
              <td width="2" background="Style/sqltools_04.gif"></td>
            </tr>
        </table></td>
      </tr>
	  <tr>
	  	<td align="center">
			连接数据库为:<asp:Label ID="lab_connName" runat="server"></asp:Label></td>
	  </tr>
      <tr>
        <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="left3">
          <tr>
            <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#D4D0C8">
                <tr>
                  <td width="3" height="6"></td>
                  <td></td>
                  <td width="3"></td>
                </tr>
                <tr>
                  <td></td>
                  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="2" height="2"><img src="Style/kuan2_01.gif" width="2" height="2" alt="" /></td>
                        <td background="Style/kuan2_02.gif"></td>
                        <td width="2"><img src="Style/kuan2_04.gif" width="2" height="2" alt="" /></td>
                      </tr>
                      <tr>
                        <td background="Style/kuan2_05.gif"></td>
                        <td valign="top">
						<div id="objectList" class="scrollpanel" style="background-color:#FFFFFF;
						height:483px;width:100%;">
						
						
						
						  </div>
						  </td>
                        <td background="Style/kuan2_07.gif"></td>
                      </tr>
                      <tr>
                        <td height="2"><img src="Style/kuan2_10.gif" width="2" height="2" alt="" /></td>
                        <td background="Style/kuan2_11.gif"></td>
                        <td><img src="Style/kuan2_13.gif" width="2" height="2" alt="" /></td>
                      </tr>
                  </table></td>
                  <td></td>
                </tr>
                <tr>
                  <td height="5"></td>
                  <td></td>
                  <td></td>
                </tr>
            </table></td>
            <td width="1" bgcolor="#808080"></td>
          </tr>
          <tr>
            <td height="1" bgcolor="#808080"></td>
            <td bgcolor="#808080"></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td id="right1" valign="top">
		<iframe id="mf" style="width:100%;height:539px;" frameBorder="false" 
		src="about.aspx" scrolling="no" ></iframe>
	</td>
  </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?