UserUpdata.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:12k
源码类别:

.net编程

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserUpdata.aspx.cs" Inherits="SysManage_UserUpdata" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5. <base target="_self" ></base>
  6.     <title>修改用户</title>
  7. <script language="javascript" type="text/javascript">
  8. <!--
  9. function AddItem (ListBox2Object,ListBox1Object) //添加指定项
  10. {
  11.      var selIndex=ListBox1Object.selectedIndex; //选定行的索引
  12.  if(selIndex==-1)
  13.         alert("请选择一项");
  14. else
  15. {
  16.     var strText=ListBox1Object.options[selIndex].text;
  17.     var strValue=ListBox1Object.options[selIndex].value;
  18.     for(i=0;i < ListBox2Object.options.length;i++)
  19.       {
  20.         if(strText==ListBox2Object.options[i].text || strValue==ListBox2Object.options[i].value)
  21.         {
  22.             alert("不可添加重复的项!");
  23.             return;
  24.         }
  25.        }  
  26.     var oItem=document.createElement("option");
  27.     oItem.text=strText;
  28.     oItem.value=strValue;
  29.     ListBox2Object.add(oItem);
  30.        var UserRoleText=document.getElementById("TB_UserRole").innerText;
  31.        var RoleIDValue=document.getElementById("txt_RoleID").innerText;
  32.         for(i=0;i<ListBox2Object.options.length;i++)
  33.          { 
  34.              var strText=ListBox2Object.options[i].text;
  35.              var strValue=ListBox2Object.options[i].value;
  36.              UserRoleText=UserRoleText + strText + ",";
  37.              RoleIDValue=RoleIDValue + strValue + ",";
  38.          }
  39.        document.getElementById("TB_UserRole").innerText=UserRoleText;
  40.        document.getElementById("txt_RoleID").innerText=RoleIDValue;
  41.   
  42.    }
  43.  
  44. }
  45. function  AddItemAll(ListBox2Object,ListBox1Object)//添加全部
  46. {
  47.    document.getElementById("txt_RoleID").innerText="";
  48.    document.getElementById("TB_UserRole").innerText="";
  49.   for(i=ListBox2Object.options.length-1;i>=0;i--)
  50.    { 
  51.       ListBox2Object.options.remove(i);
  52.       
  53.    }
  54.    var UserRoleText=document.getElementById("TB_UserRole").innerText;
  55.    var RoleIDValue=document.getElementById("txt_RoleID").innerText;
  56.   for(i=0;i<ListBox1Object.options.length;i++)
  57.     { 
  58.          var strText=ListBox1Object.options[i].text;
  59.          var strValue=ListBox1Object.options[i].value;
  60.          ListBox2Object.options.add(new Option(strText,strValue));
  61.         UserRoleText=UserRoleText + strText + ",";
  62.         RoleIDValue=RoleIDValue + strValue + ",";
  63.          
  64.     }
  65.     document.getElementById("TB_UserRole").innerText=UserRoleText;
  66.     document.getElementById("txt_RoleID").innerText=RoleIDValue;
  67.     
  68. }
  69. function DelItem(ListBox2Object)  //删除指定项
  70. {
  71.  var selIndex=ListBox2Object.selectedIndex;
  72.  if(selIndex==-1)
  73.      alert("请选择一项后再删除!");
  74.    else  
  75.      {
  76.        var RoleTexxt= ListBox2Object.options[selIndex].text;
  77.        ListBox2Object.options.remove(selIndex);
  78.        var  str= document.getElementById("txt_RoleID").innerText;
  79.        
  80.         var UserRoleText=document.getElementById("TB_UserRole").innerText;
  81.        var RoleIDValue=document.getElementById("txt_RoleID").innerText;
  82.         for(i=0;i<ListBox2Object.options.length;i++)
  83.          { 
  84.              var strText=ListBox2Object.options[i].text;
  85.              var strValue=ListBox2Object.options[i].value;
  86.              UserRoleText=UserRoleText + strText + ",";
  87.              RoleIDValue=RoleIDValue + strValue + ",";
  88.          }
  89.        document.getElementById("TB_UserRole").innerText=UserRoleText;
  90.        document.getElementById("txt_RoleID").innerText=RoleIDValue;
  91.      }
  92. }
  93. function  DelAllItem(ListBox2Object)  //删除全部
  94. {
  95.  var rows=ListBox2Object.options.length;
  96.  for(i=rows-1;i>=0;i--)
  97.    { 
  98.       ListBox2Object.options.remove(i);
  99.      
  100.    }
  101.      document.getElementById("txt_RoleID").innerText="";
  102.      document.getElementById("TB_UserRole").innerText="";
  103. if(rows==0)
  104.   alert("已全部删除!");
  105. }
  106.     function modelesswin(url,mwidth,mheight)
  107.      { 
  108.       var a=new  Array(2);
  109.        if (document.all&&window.print) 
  110.         { var re= window.showModalDialog(url,"","help:0;dialogWidth=350px;dialogHeight=400px,status=no;scroll=no;");
  111.          }
  112.          if (re!=undefined) 
  113.          {
  114.           a= re.split(',');
  115.           document.getElementById("TB_employe").innerText=a[1];
  116.           document.getElementById("txt_employeid").innerText=a[0];
  117.         }
  118.    }
  119.    
  120. // -->
  121. </script>
  122.     
  123. </head>
  124. <body  bgcolor="#f7f7f7">
  125.     <form id="form1" runat="server" >
  126.     
  127.      <TABLE width="100%"  border="0" cellPadding="0" cellSpacing="0" >
  128.         <tr valign="middle">
  129.             <td height="25px" width="17%" > 
  130.              &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <img src="../Images/assignuser.ico" height="30" >
  131.             </td>
  132.             <td  align="left"   width="83%" style="font-size:15px">
  133.                 <strong>   修改用户   </strong>
  134.             </td>
  135.         </tr> 
  136.         <tr>
  137.          <td background="../Images/Menu_bg.jpg"  height="20px">
  138.             &nbsp; &nbsp;  <img src="../Images/assignuser.ico" height="15px">     
  139.            </td>
  140.           <td  background="../Images/Menu_bg.jpg"  align="left">
  141.            
  142.            </td>
  143.         </tr>
  144.         </TABLE>
  145.        <TABLE width="100%"  border="0" cellPadding="0" cellSpacing="0" >
  146.           <tr>
  147.             <td  width="15%">  &nbsp; &nbsp; 账 号:   </td>
  148.             <td >     
  149.                 <asp:TextBox ID="TB_Account" runat="server"></asp:TextBox>     
  150.                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="必填" ControlToValidate="TB_Account" ValidationGroup="SaveButton" Display="Dynamic"></asp:RequiredFieldValidator>     
  151.             </td>
  152.              <td>   &nbsp; &nbsp;  &nbsp; &nbsp;  &nbsp; &nbsp;描 述: </td>
  153.             <td align="left" rowspan="2">     
  154.                 <asp:TextBox ID="TB_Decs" runat="server" Width="242px" TextMode="MultiLine"></asp:TextBox>      
  155.             </td>
  156.           </tr>
  157.           <tr>
  158.             <td>
  159.                 &nbsp; &nbsp; 职 工:
  160.              </td>
  161.              <td colspan="3">
  162.               <%--   <asp:Label ID="LB_EmpName" runat="server"></asp:Label> <br />--%>
  163.                 
  164.                  <asp:TextBox ID="TB_employe" runat="server"  Enabled="false"></asp:TextBox>  
  165.                    <input type="hidden" id="txt_employeid" name="txt_employeid"   runat="server">
  166.                   <a href="javascript: modelesswin('EmpTree.aspx',100,100)" ID="A1" title="选择职工"><img src="image/user.gif"  border="0"></a>
  167.                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="必填" ControlToValidate="TB_employe" ValidationGroup="SaveButton" Display="Dynamic"></asp:RequiredFieldValidator>    
  168.              </td>
  169.             
  170.           </tr>  
  171.           <tr>
  172.               <td> &nbsp; &nbsp; 关联角色: </td>
  173.              <td colspan="3">  <%--<asp:TextBox ID="TB_UserRole" runat="server" Width="160px" Enabled="false"></asp:TextBox> --%>
  174.                  <input id="TB_UserRole" type="text" runat="server" disabled="disabled" style="width:500px;" />
  175.               <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="必填" ControlToValidate="TB_UserRole" ValidationGroup="SaveButton" Display="Dynamic"></asp:RequiredFieldValidator>    
  176.                </td>
  177.           
  178.           </tr>
  179.           
  180.             <tr>
  181.            <td width="10px"></td>
  182.              <td colspan="2" > 
  183.                 <TABLE   border="0" cellPadding="0" cellSpacing="0" >
  184.                 <tr>  
  185.                  <td>待选角色</td>
  186.                   <td></td>
  187.                   <td>已选角色</td>
  188.                 </tr>
  189.                     <tr>
  190.                          <td>
  191.                           <%-- <asp:ListBox ID="LB_Role1" runat="server" Height="150px" Width="92px"><asp:ListItem Value="12" Text="12"></asp:ListItem></asp:ListBox>--%>
  192.                            
  193.                            <select id="Select1" runat="server"   size="6" style="width: 90px">
  194.                                
  195.                              </select> 
  196.                          </td>
  197.                          <td align="center">
  198.                              <input type="hidden" id="txt_RoleID" name="txt_RoleID"   runat="server">
  199.                              <input id="BT_AddAll" type="button"  runat="server"   style="width:75px;"    value="添加全部>>" language="javascript" onclick="AddItemAll(body.all.Select2,body.all.Select1)"/><br/> 
  200.                              <input id="BT_AddOne" type="button"  runat="server"    style="width:75px;"   value="添加>" language="javascript" onclick="AddItem(body.all.Select2,body.all.Select1)" /><br/>
  201.                             
  202.                              <input id="BT_DelOne" type="button"  runat="server"   style="width:75px;" value="<删除" language="javascript" onclick="DelItem(body.all.Select2)" /><br/>
  203.                              
  204.                              <input id="BT_DelAll" type="button"  runat="server"   style="width:75px;" value="<<删除全部" language="javascript" onclick="DelAllItem(body.all.Select2)" />
  205.                              
  206.  
  207.                           </td>
  208.                             <td>
  209.                           
  210.                               <select id="Select2" runat="server"  size="6"   style="width: 90px">
  211.                                
  212.                              </select></td>
  213.                 </tr>
  214.                 </TABLE>
  215.                
  216.            
  217.               </td>
  218.               
  219.           </tr>  
  220.           
  221.            <tr height="2px">
  222.              <td colspan="4" background="image/header_bg.gif">  </td>
  223.              
  224.           </tr> 
  225.            <tr height="10px" >
  226.              <td>  </td>
  227.              <td>  </td>
  228.               <td>  </td>
  229.              <td>  </td>
  230.           </tr> 
  231.            <tr>
  232.              <td> 
  233.                  &nbsp; &nbsp;  &nbsp; &nbsp;  <asp:CheckBox ID="CB_isLock" runat="server"  Text="禁用"/></td>
  234.              <td>   &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; 
  235.                 <asp:CheckBox ID="CB_isIPbound" runat="server"  Text="绑定IP地址"/>   </td>
  236.               <td>  &nbsp; &nbsp; &nbsp; &nbsp; IP地址:  </td>
  237.              <td>    <asp:TextBox ID="TB_address" runat="server" Width="160px"></asp:TextBox>       </td>
  238.           </tr> 
  239.           
  240.           <%-- <tr>
  241.              <td>  开始时间: </td>
  242.           
  243.             <td> <asp:TextBox ID="TB_FromDate" runat="server" Width="160px"></asp:TextBox>       </td>
  244.              <td>  截止时间: </td>
  245.              <td > 
  246.                 <asp:TextBox ID="TB_ToDate" runat="server" Width="160px"></asp:TextBox>       </td>
  247.           </tr> --%>
  248.            
  249.           <tr height="20px">
  250.              <td>  </td>
  251.              <td>  </td>
  252.               <td>   </td>
  253.               <td>  </td>
  254.           </tr> 
  255.             <tr height="2px">
  256.              <td colspan="4" background="image/header_bg.gif">  </td>
  257.              
  258.           </tr> 
  259.           
  260.           <tr>
  261.              <td colspan="4" align="center">  
  262.          
  263.              
  264.                    <asp:ImageButton ID="BT_Confirm" runat="server" ImageUrl="image/queding.gif" OnClick="BT_Confirm_Click" ValidationGroup="SaveButton"/>
  265.                   
  266.                   <asp:ImageButton   ID="BT_Cancel" runat="server" ImageUrl="image/quxiao.gif" />
  267.              
  268.               </td>
  269.           </tr> 
  270.           
  271.         </TABLE>
  272.         
  273.         <input type="hidden" id="txt_password" name="txt_password"   runat="server">
  274.     </form>
  275. </body>
  276. </html>