EditGroupChild.aspx
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:5k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditGroupChild.aspx.cs" Inherits="OThinker.H3.Portal.EditGroupChild" %>
  2. <%@ Register assembly="OThinker.H3.WorkSheet" namespace="OThinker.H3.WorkSheet" tagprefix="sheetcontrols" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6.     <title>Untitled Page</title>
  7.     <style type="text/css">
  8. td {
  9. font-family: "verdana","arial","宋体";
  10. font-size: 9pt;
  11. line-height: 15pt;
  12. }
  13.     </style>
  14.     <script type="text/javascript">
  15. function selectedUser(nameId, valueId, listId, idTextId)
  16. {
  17.     var text = document.getElementById(nameId).value;
  18.     var value = document.getElementById(valueId).value;
  19.     if(text == null || text == "")
  20.     {
  21.         window.alert("没有选中的子成员");
  22.         return;
  23.     }
  24.     else
  25.     {
  26.         addUser(text, value, listId, idTextId);
  27.         document.getElementById(nameId).value = "";
  28.         document.getElementById(valueId).value = "";
  29.     }
  30. }
  31. // 向List中添加选定的用户
  32. function addUser(Text, Value, listId, idTextId)
  33. {
  34.     var objlist=document.getElementById(listId);
  35.     for(i=objlist.length-1;i>=0;i--)
  36.     {   
  37.         if(objlist.options[i].value == Value)
  38.         {
  39.             return;
  40.         }
  41.     }   
  42.   
  43.     node = document.createElement("<option value='" + Value + "'>");
  44.     text = document.createTextNode(Text);
  45.     node.appendChild(text);
  46.     objlist.appendChild(node);
  47.     
  48.     document.getElementById(idTextId).value += Value + ";";
  49. }
  50. function removeUser(listId, selectedIdId)
  51.     var objlist=document.getElementById(listId);
  52.     var removedId;
  53.     for(i=objlist.length-1;i>=0;i--)
  54.     {
  55.         if(objlist.options[i].selected == true)
  56.         {
  57.             removedId = objlist.options[i].value;
  58.             objlist.remove(i);
  59.         }
  60.     }
  61.     
  62.     if(removedId != null && removedId != "")
  63.     {
  64.         // 从ID文本中删除
  65.         var selectedUsers = document.getElementById(selectedIdId).value;
  66.         var start = selectedUsers.indexOf(removedId);
  67.         var preStr = selectedUsers.substring(0, start);
  68.         var postStart = start + removedId.length + 1;
  69.         var postEnd = selectedUsers.length;
  70.         var postStr = selectedUsers.substring(postStart, postEnd);
  71.         
  72.         document.getElementById(selectedIdId).value = preStr + postStr;
  73.     }
  74. }
  75.     </script>
  76. </head>
  77. <body leftmargin="0" topmargin="0">
  78.     <form id="form1" runat="server">
  79.     <div>
  80.     <table cellpadding="0" cellspacing="0" width="100%">
  81.                     <tr>
  82.                         <td bgcolor="#7f97da" height="25">
  83.                             <table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  84.                                 <tr>
  85.                                     <td width="3%">
  86.                                         <asp:ImageButton ID="btnOk" runat="server" ImageUrl="images/IB_Ok.gif" /></td>
  87.                                     <td width="97%">
  88.                                         <asp:LinkButton ID="lnkOk" runat="server" OnClick="lnkOk_Click"><font color="#FFFFFF">确定</font></asp:LinkButton>
  89.                                     </td>
  90.                                 </tr>
  91.                             </table>
  92.                         </td>
  93.                     </tr>
  94.                 </table>
  95.     <table width=100%>
  96.         <tr>
  97.             <td>
  98.             <sheetcontrols:userselector id="txtChild" runat="server" selectunittype="User"
  99.                                             selectuserurl="SelectUser.aspx" 
  100.                                             SelectUserImageUrl="images/IB_SelectUser.GIF" 
  101.                                             RemoveUserImageUrl="images/IB_Remove.ico" UserSelectable="True" 
  102.                                             Width="178px" GroupSelectable="True"></sheetcontrols:userselector></td>
  103.         </tr>
  104.         <tr>
  105.             <td>
  106.                 <asp:PlaceHolder ID="PlaceHolderEdit" runat="server"></asp:PlaceHolder>
  107.             </td>
  108.         </tr>
  109.         
  110.         <tr>
  111.             <td>
  112.                 <asp:ListBox ID="lstChild" runat="server" Height="216px" Width="300px">
  113.                 </asp:ListBox>
  114.             </td>
  115.         </tr>
  116.         
  117.         <tr>
  118.             <td>
  119.                 <asp:TextBox ID="txtSelectedIds" runat="server" Width=100%></asp:TextBox>
  120.             </td>
  121.         </tr>
  122.     </table>    
  123.     </div>
  124.     </form>
  125. </body>
  126. </html>