<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="SWTraining.Login" %>

<%@ Register Src="UserCol/ValidateCode.ascx" TagName="ValidateCode" TagPrefix="uc3" %>
<%@ Import Namespace="SWTraining" %>
<!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>
        <%=swq.SystemName%></title>
    <link id="linkStyle" runat="server" href="Themes/Orange/css.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript">


        //选择菜单代码:::::::::::::
        var lastSelected = null;

        function Selected(the, type) {
            if (the == lastSelected) {
                return;
            }


            var TdSelected = the;
            TdSelected.className = "bgimg1 TdSelected bgc6";
            if (lastSelected != null) {
                lastSelected.className = "Nav_td";
            }
            lastSelected = TdSelected;
            document.getElementById("hfdLoginType").value = type;
            if (type == 1) {
                Account.innerHTML = "登录名：";
            }
            else {
                Account.innerHTML = "学号：";
            }
        }

        function mouseover(the) {
            currentClass = the.className;
            if (currentClass == 'Nav_td') the.className = 'Nav_td mouseoverbg bgc4';
        }

        function mouseout(the) {
            if (the != lastSelected)
                the.className = currentClass;
        }



        function defaultSelected() {
            var type = document.getElementById("hfdLoginType").value;
            if (type == 1) {
                tduser = document.getElementById("user");
                Selected(tduser, 1);
            }
            else {
                tdstu = document.getElementById("stu");
                Selected(tdstu, 1);
            }

            var showtype = document.getElementById("hfdShowType").value;
            if (showtype != 3) {
                if (showtype == 1)
                    document.getElementById("stu").style.display = "none";
                else
                    document.getElementById("user").style.display = "none";
            }

        }


        
    </script>

    <style>
        .Nav_td
        {
            width: 100px;
            border-style: solid;
            border-width: 0px 0px 1px 0px;
            cursor: pointer;
            cursor: hand;
            height: 26px;
            text-align: center !important;
        }
        .TdSelected
        {
            width: 100px;
            border-style: solid !important;
            border-width: 1px 1px 0px 1px !important;
            background-repeat: repeat-x !important;
            text-align: center;
            height: 26px;
            font-weight: bold;
        }
        .mouseoverbg
        {
            font-weight: bold;
        }
        td div
        {
            height: 1px;
            font-size: 1px;
            line-height: 1px;
        }
    </style>
</head>
<body onload="defaultSelected()">
    <form id="form1" runat="server">
    <div class="divpanel" style="margin-top: 80px; text-align: center">
        <table style="width: 350px; text-align: left; margin-left: auto; margin-right: auto;
            border-width: 1px" cellspacing="0">
            <tr class="bgc2">
                <th colspan="11" style="height: 2px;">
                    <div>
                    </div>
                </th>
            </tr>
            <tr class="bgc2">
                <td class="Nav_td" style="width: 10px;">
                    &nbsp;
                </td>
                <td class="Nav_td" id="user" onclick="Selected(this,1)" onmouseover="mouseover(this)"
                    onmouseout="mouseout(this)">
                    员工登录
                </td>
                <td class="Nav_td" id="stu" onclick="Selected(this,2)" onmouseover="mouseover(this)"
                    onmouseout="mouseout(this)">
                    学员登录
                </td>
                <td class="Nav_td">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="4" class="bgc6">
                    <table cellpadding="4">
                        <tr>
                            <td style="width: 126px; text-align: right;" id="Account">
                                帐号：
                            </td>
                            <td style="width: 351px">
                                <asp:TextBox ID="tbxUserName" runat="server" Width="109px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="_tbxUserName" runat="server" ControlToValidate="tbxUserName"
                                    Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 126px; text-align: right;">
                                密码：
                            </td>
                            <td style="width: 351px">
                                <asp:TextBox ID="tbxPassword" runat="server" Width="109px" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="_tbxPassword" runat="server" ControlToValidate="tbxPassword"
                                    Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr runat="server" id="trValidateNum">
                            <td style="width: 126px; text-align: right;">
                                验证码：
                            </td>
                            <td style="width: 351px">
                                <uc3:ValidateCode ID="ValidateCode1" runat="server" Partition="userlogin" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 126px; text-align: right;">
                                会话：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlSaveCookie" runat="server">
                                    <asp:ListItem Value="0">不保存</asp:ListItem>
                                    <asp:ListItem Value="1">保存</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 126px">
                            </td>
                            <td align="left">
                                <asp:Button ID="btnSubmit" runat="server" Text="登录" OnClick="btnSubmit_Click"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hfdLoginType" runat="server" Value="1" />
        <asp:HiddenField ID="hfdShowType" runat="server" Value="3" />
        <div style="margin: 10px">
            <%=ViewState["Copyright"]%></div>
    </div>
    </form>
</body>
</html>
