<%@ page language="C#" autoeventwireup="true" inherits="admin_label_SetOutdatabase, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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></title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />
    <script src="../../js/Common.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Conn() {
            var type = commonRadio("radType");
            var server = DianCMS_$("txtServer").value;
            var database = DianCMS_$("txtDatabase").value;
            var userid = DianCMS_$("txtUserId").value;
            var password = DianCMS_$("txtPassWord").value;
            var port = DianCMS_$("txtPort").value;
            D.BLL.B_Outdatabase.AjaxExistsConn(server, database, userid, password, type, port, callback)
        }

        function callback(res) {
            alert(res.value);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td>
                <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                您现在的位置：<a href="../info.aspx">后台管理</a> >> <a href="putdatabaselist.aspx">外部数据库列表</a>
                >> 设置外部数据库
            </td>
        </tr>
    </table>
    <table class="border" cellspacing="1" cellpadding="0" width="99%" border="0" align="center">
        <tr>
            <td class="bqleft">
                别名：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtName" runat="server"  CssClass="in1" Text=""></asp:TextBox><font color="red">*</font> 如：DianCMS论坛数据库
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                数据库类型：
            </td>
            <td class="bqright">
                <asp:RadioButtonList ID="radType" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="mssql" Selected="True">MsSql</asp:ListItem>
                    <asp:ListItem Value="mysql">MySql</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                数据库服务器：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtServer" runat="server"  CssClass="in1" Text="(local)"></asp:TextBox> MySql时，本地填写localhost
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                用户名：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtUserId" runat="server"  CssClass="in1"></asp:TextBox> <asp:Literal
                    ID="Literal1" runat="server"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                密码：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtPassWord" runat="server" CssClass="in1"></asp:TextBox> <asp:Literal
                    ID="Literal2" runat="server"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                端口：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtPort" runat="server" CssClass="in1" Text="3306"></asp:TextBox> MySql时，需要填写端口
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                数据库名称：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtDatabase" runat="server"  CssClass="in1"></asp:TextBox>
                <input id="Button2" type="button" value=" 检测连接 " class="btn" onclick="Conn()" /></td>
        </tr>
        <tr>
            <td class="bqleft">
            </td>
            <td class="bqright" height="40">
                <asp:Button ID="Button1" runat="server" Text=" 确认 " CssClass="btn radius30 pad_0_30" 
                    onclick="Button1_Click" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
