<%@ page language="VB" masterpagefile="~/Page.master" autoeventwireup="false" inherits="WebExam.Web.newUsers, App_Web_st1xh0ee" title="批量建用户" %>

<%@ Register Src="~/modul/WebMsg.ascx" TagName="WebMsg" TagPrefix="uc1" %>
<asp:Content ID="head" ContentPlaceHolderID="ContentHead" runat="Server">
    <link rel="stylesheet" href="../../../style/selfreg.css" type="text/css" />
    <link type="text/css" href="/jslib/jquery/plugins/SpinButton/JQuerySpinBtn.css" rel="stylesheet" />
    <script type="text/javascript" src="/jslib/jquery/plugins/SpinButton/JQuerySpinBtn.js"></script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" runat="Server">
    

    <script type="text/javascript" src="../../../script/regvalid.js"></script>

    <script type="text/javascript">
        $().ready(
        function() {

        $("#<%= TB_start.ClientId() %>").SpinButton({ min: 0 });
        $("#<%= TB_end.ClientId() %>").SpinButton({ min: 1 });


        });
    
    
     function lifeDateChange(obj){
         var d_len=document.getElementById("<%= DDL_len.ClientID %>");
         if(obj.value=='l')
          d_len.style.display="none";
         else
          d_len.style.display="block";
       
      
       }
      
      
     function ClientValidateUserId(oSrc, args)//验证用户名是否正确
{
  var strr="";
  var data=args.Value;
  
  var find=0;
  for(var i=0;i<data.length;i++){
    if(data.charAt(i)=="*")find++;else
    strr+=data.charAt(i);
  };
  if ((find!=1)||(strr=="")){args.IsValid =false;return ;}
  
  
  var reg=/[^a-z0-9A-Z_\u4e00-\u9fa5]/g;
  var arr=strr.match(reg);
 
 if(arr!=null)
  
    args.IsValid =false ;
  else
    args.IsValid = true;
}
      function checkInput(){
      if((event.keyCode>=48)&&(event.keyCode<=57))event.returnValue= true; else event.returnValue= false;
      
      }
    </script>

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True" EnableScriptGlobalization="True">
    </asp:ScriptManager>
    <uc1:WebMsg ID="WebMsg1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <ul class="clear">
        <li class="clear">
            <p class="creat fleft clear">
                设置用户名密码</p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                注册到：</div>
            <div class="input_list font_space fleft">
                <asp:Label ID="L_fullPartName" runat="server" class="name_aready"></asp:Label>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                账号有效期：</div>
            <div class="input_list font_space fleft">
                <asp:DropDownList ID="DDL_len" runat="server" CssClass="fleft">
                </asp:DropDownList>
                <asp:DropDownList ID="DDL_lifeDate" runat="server" onchange="lifeDateChange(this);"
                    CssClass="fleft">
                    <asp:ListItem Value="l" Text="长期"></asp:ListItem>
                    <asp:ListItem Value="d" Text="日"></asp:ListItem>
                    <asp:ListItem Value="m" Text="月"></asp:ListItem>
                    <asp:ListItem Value="y" Text="年"></asp:ListItem>
                </asp:DropDownList>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 用户名格式：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_userId" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                    onfocus="this.style.borderColor='#99E300';" AutoCompleteType="Disabled"></asp:TextBox>
                <div class="error_explain font_space" id="chkuserid" style="width: 100%">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请填写用户名！"
                        ControlToValidate="TB_userId" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="CustomValidatorUserId" runat="server" ControlToValidate="TB_userId"
                        ErrorMessage="用户名中必须包含一个占位符*，用户名中只能使用汉字、字母、数字及下划线等字符" ClientValidationFunction="ClientValidateUserId"
                        Display="Dynamic"></asp:CustomValidator>
                </div>
            </div>
            <div class="explain_list fleft">
                <span class="explain">用户名格式由正常的用户名和一个占位符*组成，*可位于用户名任意位置，系统将用自动产生的字符串代替*，最终产生多个用户名</span>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span>占位符范围：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_start" runat="server" MaxLength="3" onkeypress="checkInput();" Width="40" Text="0" />
               
                ——
                <asp:TextBox ID="TB_end" runat="server" MaxLength="3" onkeypress="checkInput();"  Width="40" Text="1" />
               
                <div class="error_explain font_space" style="width: 100%">
                    <asp:RequiredFieldValidator ControlToValidate="TB_start" ID="RequiredFieldValidator1"
                        runat="server" ErrorMessage="请填写起止范围" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ControlToValidate="TB_end" ID="RequiredFieldValidator4"
                        runat="server" ErrorMessage="请填写起止范围" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="起止范围有误"
                        Display="Dynamic" ControlToValidate="TB_start" ControlToCompare="TB_end" Operator="LessThan"
                        Type="Integer"></asp:CompareValidator>
                </div>
            </div>
            <div class="explain_list fleft">
                <span class="explain">系统将使用起止范围内的数字依次递增产生不同的字符串代替*，以最终产生多个用户名.一次最多可产生100个用户名</span>
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 密 码：</div>
            <div class="input_list font_space fleft">
                <asp:TextBox ID="TB_password" runat="server" MaxLength="36" onblur="this.style.borderColor='#A3BFA8';checkPWD(this.value);"
                    onfocus="this.style.borderColor='#99E300';this.style.borderColor='#99E300'" onkeyup="checkPWD(this.value);"
                    Width="230px"></asp:TextBox>
                <div class="error_explain font_space" id="chkPwd">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入6～20位字符的密码"
                        ControlToValidate="TB_password" Display="Dynamic"></asp:RequiredFieldValidator></div>
                <div class="PSW_P_0" id="chkpswd">
                    <div class="PSW_P_W">
                        密码安全程度：<span id="chkpswdcnt">太短</span></div>
                    <div class="PSW_P_BGC">
                        <div class="PSW_P_pC">
                        </div>
                    </div>
                </div>
            </div>
            <div class="explain_list fleft">
                <span class="explain">密码长度6～20位，由英文字母a～z (区分大小写)，数字0～9，特殊字符组成。</span></div>
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <p class="creat fleft clear">
                个人资料</p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                <span class="atten">*</span> 性 别：</div>
            <div class="input_list font_space fleft">
                <asp:RadioButtonList ID="gender" runat="server" BorderStyle="none" Style="border: 0px"
                    RepeatDirection="Horizontal" BorderWidth="0" RepeatLayout="Flow">
                    <asp:ListItem Text="男  " Value="1"></asp:ListItem>
                    <asp:ListItem Text="女" Value="0"></asp:ListItem>
                </asp:RadioButtonList>
                <div class="error_explain font_space" id="genderConfirm">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="请选择性别"
                        ControlToValidate="gender" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
            </div>
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <p class="creat fleft clear">
                产生的用户列表</p>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
                
            </div>
           
                <asp:TextBox ID="TextBox1" runat="server" style="float:left" TextMode="MultiLine" ReadOnly="True" Width="400px" Height="100px"></asp:TextBox>
           
           
        </li>
        <li class="clear">
            <div class="compart">
            </div>
        </li>
        <li class="clear">
            <div class="name_list font_space fleft">
            </div>
            <div class="input_list font_space fleft">
                <asp:Button ID="Btn_save" runat="server" Text="确定" />
            </div>
        </li>
    </ul>
    </ContentTemplate>
    </asp:UpdatePanel>
    
    <br />
</asp:Content>
