<%@ Page Title="" Language="C#" ClientIDMode="Static" MasterPageFile="Basic.Master" AutoEventWireup="true" CodeBehind="UserEditUser.aspx.cs" Inherits="ServiceDesk.Admin.UserEditUser" %>
 
 
<asp:Content ID="Content3" ContentPlaceHolderID="body" runat="server">

     

     



  
    
   
  

              <table  class=" layui-table table2"     >

        <tbody> 
        <tr  >     
         <th class="req"  >用户名  </th>
          <td  > 
             <asp:TextBox   ID="username"  CssClass="layui-input"  autocomplete="off"   runat="server"></asp:TextBox>  
            <asp:RequiredFieldValidator ControlToValidate="username" ID="RequiredFieldValidator2" runat="server" ErrorMessage="用户名不能够为空" Display="Dynamic"></asp:RequiredFieldValidator>
        </td>
           
        <th  >密码
          
            <asp:PlaceHolder runat="server" ID="pl_pwd">
                <span style="color:#ff0000">*</span>
            </asp:PlaceHolder>

        </th>
        <td  width="200px" > 
             <asp:TextBox ID="password" autocomplete="off"    CssClass="layui-input"   runat="server"  ></asp:TextBox> 
              <asp:RequiredFieldValidator ControlToValidate="password" ID="RequiredFieldValidator1" runat="server" ErrorMessage="密码不能够为空" Display="Dynamic"></asp:RequiredFieldValidator>
             <a href="###" class="mylink" onclick="gen();">随机生成密码</a>
          </td>
         
        <th  rowspan="2" valign="middle"> 头像</th>
          <td rowspan="2"  > 
                
               
                      <img src="images/avtor.jpg" id="img_avtor"   style="width:80px; border:solid 1px #ccc; margin:5px;   vertical-align:middle" />
                  
                   
                    <a href="###" onclick="window.open('Upload.aspx'); return false;">上传图片</a>

                    <div style=" display:none ">
					  <asp:textbox id="image_small" Width="150px"  ClientIDMode="Static" Runat="server"></asp:textbox> 
			          <asp:textbox id="image_big" ClientIDMode="Static" Width="150px" Runat="server"></asp:textbox>
                  </div>
					  
         </td>
           
           </tr>

             


           
           <tr>
           
     <th>邮件</th>
         <td> 
            <asp:TextBox ID="email"   CssClass="layui-input"    runat="server"></asp:TextBox>  
         </td>
          
          
          
          
          
           <th  >部门</th>
           <td> 
           
               
           <div class="flex">
            <asp:TextBox ID="department"  ClientIDMode="Static"  CssClass="layui-input department"     runat="server"></asp:TextBox> 
              <a href="###"  onclick="setdept();" class="layui-btn layui-btn-normal"  >选择 </a> 
            </div> 

               
            </td>  
          
          
           </tr>
          
          
      
          
  <tr>    
      <th  >显示名</th>
            <td> 
              <asp:TextBox ID="displayname"  autocomplete="off"  CssClass="layui-input" runat="server"></asp:TextBox>
             </td>


    <th  >电话</th>
      <td>  
              <asp:TextBox ID="tel"   CssClass="layui-input"  runat="server"></asp:TextBox>  
      </td> 

      	 <th  >传真</th>
		  <td  >
		 
           <asp:TextBox ID="fax"   CssClass="layui-input"  runat="server"></asp:TextBox>  
		
        
         </td>

        
       </tr>
          
          
          <tr>  
            <th >办公室</th>
             <td>
             <asp:TextBox ID="office"   CssClass="layui-input"   runat="server"></asp:TextBox> 
            </td>

          
         <th >职务</th>
          <td >  
              <asp:TextBox ID="title"   CssClass="layui-input"  runat="server"></asp:TextBox>   
           </td>
            
                  
                    
      <th >手机</th>
        <td> 
              <asp:TextBox ID="mobile"   CssClass="layui-input"  runat="server"></asp:TextBox>   
         </td> 

  </tr>
          
          
          
           <tr> 
           
           <th>员工号</th>
            <td >  
              <asp:TextBox ID="staffcode"   CssClass="layui-input"  runat="server"></asp:TextBox>   
           </td>
            
          
         <th  >性别</th>
          <td  >  
              <asp:DropDownList ID="sex"  lay-ignore CssClass="form-control" runat="server" Width="140px">
              <asp:ListItem Text="" Value=""></asp:ListItem>
              <asp:ListItem Text="男" Value="男"></asp:ListItem>
              <asp:ListItem Text="女" Value="女"></asp:ListItem>
              </asp:DropDownList> 
           </td>
           
            
               <th>

               </th>

           <td title="建立用户或者重置密码时，可以邮件通知用户">
               <input type="checkbox" runat="server" id="cb_notice"  title="通知用户" lay-skin="primary"/>
           </td>
	
            
           
          </tr>
          
           
          
           
          
           <tr >
         <th  >
          自我简介 
              </th>
               <td colspan="5">
           
              <asp:TextBox ID="intro"  CssClass="layui-input"   height="80px"
                   TextMode=MultiLine  runat="server"></asp:TextBox>
         
          </td>
          </tr>   
          
          
          
         <tr >
          <td colspan="6" align="center"  class="text-center">
              
               
                <asp:Button ID="add"  runat="server" OnClick="add_Click"  class="layui-btn"    Text="添加" />
            
               
             
              <asp:Button ID="update"  runat="server" OnClick="update_Click" class="layui-btn"   Text="更新" />
              
              
               <asp:Button ID="del"  CausesValidation="false" runat="server" OnClick="del_Click"   
                    OnClientClick="return confirm('确定要删除吗');" class="layui-btn layui-btn-danger"  Text="删除" />
              
                                    
          </td></tr>
          
          
        
 
</tbody>
</table>
  
  
 
    
    
      

        <script>

            function ResetImg(s, b) {

                $("#image_small").val(s);
                $("#image_big").val(b);
                $("#img_avtor").attr("src", s);
              

            }
        
        
        </script>

        


      
   
        <script>

            function setdept() {
                layer.open({
                    type: 1,
                    title:"选择部门",
                    skin: 'layui-layer-rim', //加上边框
                    area: ['420px', '240px'], //宽高
                    content: '<%=UsersHelper.GetPopDept() %>'
                });
            }
             

            function closedept(cont) {
                $(".department").val($(cont).html());
                layer.closeAll();
            }

        </script>
    
     

       <script>

           

           function gen() {
               var p = GenPwd();
               $("#password").val(p);

           }

           function GenPwd() {
               var str1 = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"; //26
               str1 = str1.split(' ');

               var str2 = "a b c d e f g h i j k l m n o p q r s t u v w x y z"; //26
               str2 = str2.split(' ');

               var num = "0 1 2 3 4 5 6 7 8 9"; //10
               num = num.split(' ');

               var spec = "! @ # $ ( ) .";  //7
               spec = spec.split(' ');


               var pwd1 = str1[randomNum(0, 25)]; 
               var pwd2 = str2[randomNum(0, 25)];
               var pwd3 = str2[randomNum(0, 25)];
               var pwd4 = str2[randomNum(0, 25)];
              
               var pwd5 = spec[randomNum(0, 6)]

               var pwd6 = num[randomNum(0, 9)]
               var pwd7 = num[randomNum(0, 9)]
               var pwd8 = num[randomNum(0, 9)]



               return pwd1 + pwd2 + pwd3 + pwd4 + pwd5 + pwd6 + pwd7 + pwd8;


           }



           function randomNum(minNum, maxNum) {
               switch (arguments.length) {
                   case 1:
                       return parseInt(Math.random() * minNum + 1, 10);
                       break;
                   case 2:
                       return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
                       break;
                   default:
                       return 0;
                       break;
               }
           }




       </script>
     
    

</asp:Content>
