<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostUser.aspx.cs" Inherits="SWTraining.Admin.PostUser"
    Title="系统设置-编辑用户" %>

<%@ 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></title>
    <link id="linkStyle" runat="server" href="../Themes/Orange/css.css" rel="stylesheet"
        type="text/css" />
</head>

<script type="text/javascript">

    function Face(src) {
        document.getElementById("imgFace").src = "../images/userface/" + src;
    }

    function ValidPassword(source, arguments) {
        var pwd = document.getElementById("tbxPassword").value;
        var pwd2 = document.getElementById("tbxPassword2").value;
        if (pwd != "") {
            if (pwd2 == "") {
                document.getElementById("_Password").innerText = "请再次输入密码！";
                arguments.IsValid = false;

            }
            else {
                if (pwd != pwd2) {
                    document.getElementById("_Password").innerText = "两次密码不一致！";
                    arguments.IsValid = false;

                }
            }
        }
    }
</script>

<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" AllowCustomErrorsRedirect="False">
    </asp:ScriptManager>
    <table class="table" cellspacing="0">
        <tr>
            <th colspan="2">
                编辑员工权限
            </th>
        </tr>
        <tr>
            <td>
                真实姓名：
            </td>
            <td>
                <asp:TextBox ID="tbxTrueName" runat="server"></asp:TextBox>
                <span style="color: Red">*</span>
            </td>
        </tr>
        <tr>
            <td>
                登录名：<td>
                    <asp:TextBox ID="tbxUserName" runat="server"></asp:TextBox>
                </td>
        </tr>
        <tr>
            <td>
                密码：<td>
                    <asp:TextBox ID="tbxPassword" runat="server" TextMode="Password"></asp:TextBox>
                    不修改密码，为空即可。
                </td>
        </tr>
        <tr>
            <td>
                确认密码：<td>
                    <asp:TextBox ID="tbxPassword2" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:CustomValidator ID="_Password" runat="server" ClientValidationFunction="ValidPassword"
                        ControlToValidate="tbxPassword2" ValidateEmptyText="True"></asp:CustomValidator>
                </td>
        </tr>
        <tr>
            <td>
                头像：<td>
                    <asp:DropDownList runat="server" ID="ddlUserFace">
                        <asp:ListItem Value="1.gif">1</asp:ListItem>
                        <asp:ListItem Value="2.gif">2</asp:ListItem>
                        <asp:ListItem Value="3.gif">3</asp:ListItem>
                        <asp:ListItem Value="4.gif">4</asp:ListItem>
                        <asp:ListItem Value="5.gif">5</asp:ListItem>
                        <asp:ListItem Value="6.gif">6</asp:ListItem>
                        <asp:ListItem Value="7.gif">7</asp:ListItem>
                        <asp:ListItem Value="8.gif">8</asp:ListItem>
                        <asp:ListItem Value="9.gif">9</asp:ListItem>
                        <asp:ListItem Value="10.gif">10</asp:ListItem>
                        <asp:ListItem Value="11.gif">11</asp:ListItem>
                        <asp:ListItem Value="12.gif">12</asp:ListItem>
                        <asp:ListItem Value="13.gif">13</asp:ListItem>
                        <asp:ListItem Value="14.gif">14</asp:ListItem>
                        <asp:ListItem Value="15.gif">15</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Image ID="imgFace" runat="server" />
                </td>
        </tr>
        <tr>
            <td>
                状态：
            <td>
                <asp:DropDownList runat="server" ID="ddlLockState">
                    <asp:ListItem Value="0" Selected="True" Text="禁用"></asp:ListItem>
                    <asp:ListItem Value="1" Text="启用"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                隶属组：
            </td>
            <td>
                <asp:UpdatePanel ID="upPub" runat="server">
                    <ContentTemplate>
                        <table class=" ClearCollapse">
                            <tr>
                                <td>
                                    隶属组
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    所有组
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:ListBox ID="lbxSelected" runat="server" Height="237px" Width="245px" SelectionMode="Multiple">
                                    </asp:ListBox>
                                </td>
                                <td>
                                    <br />
                                    <asp:Button ID="btnAddUser" runat="server" Height="24px" Text="&lt;加入" OnClick="btnAddUser_Click" />
                                    <br />
                                    <br />
                                    <asp:Button ID="btnRemoveUser" runat="server" Height="24px" Text="&gt;移除" OnClick="btnRemoveUser_Click" />
                                </td>
                                <td>
                                    <asp:ListBox ID="lbxUserGroups" runat="server" Height="232px" Width="251px" SelectionMode="Multiple">
                                    </asp:ListBox>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td>
                校区：
            </td>
            <td>
                <asp:DropDownList ID="ddlSchool" runat="server" DataValueField="SchoolID" DataTextField="SchoolName">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="btnAdd" runat="server" Text="提交" OnClick="btnAdd_Click"></asp:Button>
                <input causesvalidation="false" type="button" runat="server" onclick="back()" value="返回" />
            </td>
        </tr>
    </table>

    <script type="text/javascript">
        document.getElementById("ddlUserFace").onchange();
    </script>

    </form>
</body>
</html>
