<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditUser.aspx.cs" Inherits="Book.Admin.EditUser" %>

<!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>
    
    <style> 
 

  .menuItem {  font-size:8pt; width:100; padding-left:20; background-Color: menu;color:black; cursor:pointer; }
  .highlightItem { font-size: 8pt; width: 100; padding-left: 20; background-Color: highlight; color: white; cursor:pointer; }
 
  .clickableDiv { padding: 4; width: 500; background-Color: blue; color: white; border: 10px double blue; }
 .priority{ cursor:pointer}
 
 
  

</style>

 




</head>
<body style=" font-family:Verdana; font-size:12px;">
    <form id="form1" runat="server">
    <div>
    
    
      <table border="0" cellSpacing="1"  cellPadding="8"  class="reg table"      >
        <tbody>
           
         
        <tr>     
          <td class="tdwkey">用户名</td>
          <td  class="tdwvalue"> 
             <asp:TextBox   ID="username"   runat="server"></asp:TextBox> 
            <asp:RequiredFieldValidator ControlToValidate="username" ID="RequiredFieldValidator2" runat="server" ErrorMessage="用户名不能够为空" Display="Dynamic"></asp:RequiredFieldValidator>
        </td>
           
        <td class="tdwkey">密码</td>
        <td class="tdwvalue"> 
             <asp:TextBox ID="password"     runat="server"  ></asp:TextBox>
             为空表示密码表示不变  
          </td>
         
        <td class="tdwkey"> </td>
          <td class="tdwvalue"> 
               <asp:TextBox ID="confirmpassword"  Visible="false"   runat="server"></asp:TextBox> 

         </td>
           
           </tr>
           
           <tr>
           
     <td class="tdwkey">邮件</TD>
         <td class="tdwvalue"> 
                <asp:TextBox ID="email"      runat="server"></asp:TextBox>  
      <asp:RequiredFieldValidator ControlToValidate="email" ID="RequiredFieldValidator1" runat="server" ErrorMessage="邮件不能够为空" Display="Dynamic"></asp:RequiredFieldValidator>
                  
 <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="邮件格式不正确"
        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"　 Display="Dynamic"
         ControlToValidate="email"></asp:RegularExpressionValidator> 

  </td>
          
          
          
          
          
            <td class="tdwkey">部门</td>
           <td class="tdwvalue"> 
           
               <asp:TextBox ID="txt_department" runat="server"  onclick="showMenu()"></asp:TextBox> 
               
            </td>  
          
            <td class="tdwkey">显示名</td>
            <td class="tdwvalue"> 
              <asp:TextBox ID="txt_displayname" runat="server"></asp:TextBox>
             </td>
           </tr>
          
          
      
          
  <tr>    
      <td class="tdwkey">电话</TD>
      <td class="tdwvalue">  
              <asp:TextBox ID="tel"  runat="server"></asp:TextBox>  
      </td>
         
                
       <td class="tdwkey">传真</td>
        <td class="tdwvalue"> 
          <asp:TextBox ID="fax"  runat="server"></asp:TextBox>  
       </td>
            
     
             <td class="tdwkey">办公室</TD>
             <td class="tdwvalue">
             <asp:TextBox ID="office"   runat="server"></asp:TextBox> 
            </td>
       </tr>
          
          
          <tr>
          
          <td class="tdwkey">职务</TD>
          <td class="tdwvalue">  
              <asp:TextBox ID="txt_title"  runat="server"></asp:TextBox>   
           </td>
           
           
           
            
          <td class="tdwkey">员工号</TD>
      <td class="tdwvalue">  
              <asp:TextBox ID="txt_staffcode"  runat="server"></asp:TextBox>   
           </td>
           
           
                
         <td class="tdwkey"  >头像:</td>
        <td class="tdwvalue">  
         
       <asp:textbox id="image_small"   Runat="server"></asp:textbox>
        	 <asp:textbox id="image_big"   Runat="server" Visible="false"></asp:textbox>
        	<br />
          <a  href="#" onclick="window.open('upload.aspx')">上传头像</a>

        	<a href="#" onclick="resetAvtor()">清除头像</a>
        	
            <a  onmousemove="disThum('<%=image_small.ClientID %>')"  href="#"  onmouseout="hidThum()"  >预览头像</a> 
         
          <span id="spanprev"></span>  	
        		 
                 
                 
                 
                  
                 
           
               <script>

                   function updateAvtor(im) {
                       var p = document.getElementById('<%=image_small.ClientID %>');
                       p.value = im;
                   }



                   function resetAvtor() {

                       var p = document.getElementById('<%=image_small.ClientID %>');

                       p.value = "images/avtor.jpg";


                   }
          </script>
          
          
          
          
          <script>

              function ope() {
                  var p = document.getElementById('<%=image_small.ClientID %>').value;
                  window.open(p);
              }
          
          </script>
                
                 
                 
 <script  type="text/javascript">
     function disThum(obj) {

         var imgpath = document.getElementById(obj).value;



         if (imgpath != "") {
             s = document.getElementById("spanprev");
             s.style.display = "block";
             if (imgpath == "images/avtor.jpg") {
                 s.innerHTML = "<img width=100px src=../" + imgpath + " >";
             }
             else {
                
                 s.innerHTML = "<img width=100px src=" + imgpath + " >";
               
             } 
         }
     }

     function hidThum() {

         s = document.getElementById("spanprev");
         s.innerHTML = "";
         s.style.display = "none";
     }
     </script>
                 
                 		 
           </td>
          </tr>
       
          
          
          
          
          
          
          
          
          
           <tr>
          
          <td class="tdwkey">性别</td>
          <td class="tdwvalue" >  
              <asp:DropDownList ID="ddl_sex" runat="server">
              <asp:ListItem Text="" Value=""></asp:ListItem>
              <asp:ListItem Text="男" Value="男"></asp:ListItem>
              <asp:ListItem Text="女" Value="女"></asp:ListItem>
              </asp:DropDownList> 
           </td>
           
           
           
           
           
		 <td class="tdwkey">帐户属性</td>
		  <td class="tdwvalue" colspan="6" style="width:300px" >
		
             <asp:CheckBox ID="cb_ismgr" runat="server"  Text="经理" /> &nbsp;
		 
		 <asp:CheckBox ID="cb_issec" runat="server"  Text="秘书"/>&nbsp;
		 
		 	 <asp:CheckBox ID="cb_isstaff" runat="server"  Text="Staff成员"/>
		 </td>
           
           
           
          </tr>
          
          
          
          
          
          
          
          
          
          
          
          
          
           <tr class="tdwvalue">
          <td colspan="6" style=" padding-left:80px;">
          自我简介<br />
           
              <asp:TextBox ID="txt_intro" Width="600" Height=60 TextMode=MultiLine  runat="server"></asp:TextBox>
         
          </td>
          </tr>   
          
          
          
         <tr class="tdwvalue">
          <td colspan="6" align="center">
              
               
              <br />
              <asp:Button ID="update"  runat="server" OnClick="update_Click"     style=" height:22px; width:100px"   class="btn" Text="更新" />
             &nbsp;   &nbsp;
              
                            <asp:Button ID="add"  runat="server" OnClick="add_Click"     style=" height:22px; width:100px"   class="btn" Text="添加" />
    &nbsp;   &nbsp;
              <asp:Button ID="del"  CausesValidation="false" runat="server" OnClick="del_Click"     style=" height:22px; width:100px"   class="btn" Text="删除" />

                                                <br />
              <br />
              <br />
          </td></tr>
          
          
        
 
</tbody>
</table>
  
  
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
 
 <!-- popup -->
 
 
<div id="menu1" onclick="clickMenu()" onmouseover="toggleMenu()" onmouseout="toggleMenu()" 
oncontextmenu="contextTwice()" 
style="position:absolute;display:none;width:200px; height:130px;  background-Color:#f6f6f6; border:solid 1px #6593cf; z-index:200; margin:5px; padding:5px; line-height:20px">
 

   <asp:Literal runat="server" ID="lb_dept"></asp:Literal> 
 
   
</div>
 
<SCRIPT LANGUAGE="JavaScript"> 
  
  
    function showMenu() {
        whichDiv = event.srcElement;
        menu1.style.posLeft = event.clientX + document.body.scrollLeft;
        menu1.style.posTop = event.clientY + document.body.scrollTop;
        menu1.style.display = "";
        menu1.setCapture();
    }
 
    function toggleMenu() {
         el = event.srcElement;
        if (el.className == "menuItem") {
            el.className = "highlightItem";
        } else if (el.className == "highlightItem") {
            el.className = "menuItem";
        }
    }
 
    function clickMenu() {
        menu1.style.display = "none";
        el = event.srcElement;
        if (el.id != "") {
            document.getElementById('<%=txt_department.ClientID %>').value = document.getElementById(el.id).innerHTML;
        }
        menu1.releaseCapture();
          
    }
 
    function contextTwice() {
         if (event.srcElement == whichDiv)
            showMenu();
    }
</SCRIPT>
 
 
<!-- /popup -->
 

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