<%@ page language="C#" autoeventwireup="true" inherits="Install_InstallDataBase, ShopWe" %>

<!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 href="step.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
    //验证提交是否成功，成功则显示
    function CheckClientValidate()
    {
       Page_ClientValidate();
       if (Page_IsValid)
       {
           return true;
       }
       else
       {
           return false;
       }
     }

    //遮罩层
var docEle = function() 
{
    return document.getElementById(arguments[0]) || false;
}

function openNewDiv(_id) 
{
    var m = "mask";
    if (docEle(_id)) document.body.removeChild(docEle(_id));
    if (docEle(m)) document.body.removeChild(docEle(m));
    
    //mask遮罩层

    var newMask = document.createElement("div");
    newMask.id = m;
    newMask.style.position = "absolute";
    newMask.style.zIndex = "1";
    _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    newMask.style.width = _scrollWidth + "px";
    newMask.style.height = _scrollHeight + "px";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=40)";
    newMask.style.opacity = "0.40";
    document.body.appendChild(newMask);
    
    //新弹出层

    var newDiv = document.createElement("div");
    newDiv.id = _id;
    newDiv.style.position = "absolute";
    newDiv.style.zIndex = "9999";
    newDivWidth = 36;
    newDivHeight = 36;
    newDiv.style.width = newDivWidth + "px";
    newDiv.style.height = newDivHeight + "px";
    newDiv.style.top = (document.body.scrollTop + document.body.clientHeight/2 - newDivHeight/2) + "px";
    newDiv.style.left = (document.body.scrollLeft + document.body.clientWidth/2 - newDivWidth/2) + "px";
    newDiv.style.background = "#EFEFEF";
    newDiv.style.border = "1px solid #666666";
    newDiv.style.padding = "5px";
    newDiv.innerHTML = "<img src=\"../UploadImages/CommonImage/load.gif\" alt=\"LoadingImage\" />"; 
    document.body.appendChild(newDiv);
    
    //弹出层滚动居中

    function newDivCenter()
    {
        newDiv.style.top = (document.body.scrollTop + document.body.clientHeight/2 - newDivHeight/2) + "px";
        newDiv.style.left = (document.body.scrollLeft + document.body.clientWidth/2 - newDivWidth/2) + "px";
    }
    if(document.all)
    {
        window.attachEvent("onscroll",newDivCenter);
    }
    else
    {
        window.addEventListener('scroll',newDivCenter,false);
    }
    
    //关闭新图层和mask遮罩层

/*
    var newA = document.createElement("a");
    newA.href = "#";
    newA.innerHTML = "关闭";
    newA.onclick = function() 
    {
        if(document.all)
        {
            window.detachEvent("onscroll",newDivCenter);
        }
        else
        {
            window.removeEventListener('scroll',newDivCenter,false);
        }
        document.body.removeChild(docEle(_id));
        document.body.removeChild(docEle(m));
        return false;
    }
    newDiv.appendChild(newA);
    */
}
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                 <td>
                    <div class="All">
                        <div class="Top">
                            <div class="Logo">
                                <img src="images/Logo_top.gif" alt="Logo" /></div>
                        </div>
                    </div>                </td>
            </tr>
            <tr>
                <td>
                    <div class="Come">
					<div class="top_bj"><img src="images/top_bj.gif" /></div>
				<div class="zhon_bj">
                        <div class="Title">
                            <img src="images/Title3.jpg" alt="设置运行环境" /></div>
                        <div class="Step_all">
                          <div class="validate">
                                <asp:ValidationSummary ID="ValidationSummaryPage" CssClass="val_ys" runat="server"
                                    DisplayMode="List" ForeColor="#FF6600" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorAdminPassword" runat="server"
                                    ControlToValidate="AdminPassword" ErrorMessage="系统管理员密码不能为空,且不能为中文" Display="None"></asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="CompareValidatorAdminPassword" runat="server" ControlToCompare="ValidatePassword"
                                    ControlToValidate="AdminPassword" ErrorMessage="两次输入密码不同" Display="None"></asp:CompareValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorServerName" runat="server"
                                    ControlToValidate="ServerName" ErrorMessage="数据库服务器名称或IP不能为空" Display="None"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorDatabaseName" runat="server"
                                    ControlToValidate="DatabaseName" ErrorMessage="数据库名称不能为空" Display="None"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorDatabaseID" runat="server"
                                    ControlToValidate="DatabaseID" ErrorMessage="数据库用户名不能为空" Display="None"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorAdminName" runat="server" ControlToValidate="AdminName"
                                    ErrorMessage="系统管理员账号不能为空,且不能为中文" Display="None"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorValidatePassword" runat="server"
                                    ControlToValidate="ValidatePassword" ErrorMessage="确认密码不能为空" Display="None"></asp:RequiredFieldValidator>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    数据库名或IP地址：</div>
                                <asp:TextBox ID="ServerName" runat="server" Width="300px"></asp:TextBox>
                                <div class="yz">
                                    <img src="images/ico.png" /> 您的数据库服务器地址
                                </div>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    数据库名称：</div>
                                <asp:TextBox ID="DatabaseName" runat="server" Width="300px"></asp:TextBox>
                                <div class="yz">
                                    <img src="images/ico.png" /> 请填写您为ShopWe建立的数据库名称
                                </div>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    数据库用户名称：</div>
                                <asp:TextBox ID="DatabaseID" runat="server" Width="300px"></asp:TextBox>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    数据库用户密码：</div>
                                <asp:TextBox ID="DatabasePassword" runat="server" Width="300px" TextMode="Password"></asp:TextBox>
                                <div class="yz">
                                    <img src="images/ico.png" /> 填写您的数据库密码，如果没设值数据库密码，则不需要填写
                                </div>
                            </div>
                            <div class="line">
                            </div>
                            <div class="Input">
                                <div class="name">
                                    系统管理员账号：</div>
                                <asp:TextBox ID="AdminName" runat="server" Width="300px"></asp:TextBox>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    系统管理员密码：</div>
                                <asp:TextBox ID="AdminPassword" runat="server" Width="300px" TextMode="Password"></asp:TextBox>
                            </div>
                            <div class="Input">
                                <div class="name">
                                    确认密码：</div>
                                <asp:TextBox ID="ValidatePassword" runat="server" Width="300px" TextMode="Password"></asp:TextBox>
                            </div>
                        </div>
                        <div class="Button">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 70%">
                                        <asp:Button ID="SubmitButton" OnClientClick="if(CheckClientValidate()){openNewDiv('newDiv')}"
                                            CssClass="but2" runat="server" Text="设置完成，进入下一步" OnClick="SubmitButton_Click" />
                                    </td>
                                    <td>&nbsp;
                                        
                                    </td>
                                </tr>
                            </table>
                        </div>
						</div>
						<div class="down_bj"><img src="images/down_bj.gif" /></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="Down">
                        Copyright 2008 ShopWe, All Rights Reserved
                    </div>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
