authority_edit.aspx
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:4k
源码类别:

OA系统

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="authority_edit.aspx.cs" Inherits="web_system_authority_edit" %>
  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 id="Head1" runat="server">
  5.     <title>无标题页</title>
  6.     <link href="../../css/style.css" rel="stylesheet" type="text/css" />
  7.     <script language="javascript" type="text/javascript">
  8.         function check(id)
  9.         {
  10.             var current = document.getElementById("chk"+id);
  11.             
  12.             var temp1 = document.getElementsByTagName("input");  
  13.             for(var i=1; i<temp1.length; i++)
  14.             {
  15.                 if(temp1[i].type == "checkbox" && temp1[i].parent==id)
  16.                 {   
  17.                     temp1[i].checked = current.checked;
  18.                     
  19.                     var temp2 = document.getElementsByTagName("input");  
  20.                     for(var j=1; j<temp2.length; j++)
  21.                     {
  22.                         if(temp2[j].type == "checkbox" && ("chk"+temp2[j].parent)==temp1[i].id)
  23.                         {
  24.                                 temp2[j].checked = current.checked;
  25.                                 
  26.                                 var temp3 = document.getElementsByTagName("input");  
  27.                                 for(var k=1; k<temp3.length; k++)
  28.                                 {
  29.                                     if(temp3[k].type == "checkbox" && ("chk"+temp3[k].parent)==temp2[j].id)
  30.                                     {
  31.                                             temp3[k].checked = current.checked;
  32.                                     }
  33.                                 }
  34.                         }
  35.                     }
  36.                 }
  37.             } 
  38.         }
  39.         function sum()
  40.         {
  41.             var flag = "0";
  42.             var menus = "";
  43.             for(var i=0; i<1000; i++)
  44.             {
  45.                 if(document.getElementById("chk"+i)!=null)
  46.                 {
  47.                     if(document.getElementById("chk"+i).checked)
  48.                     {
  49.                         flag = "1"
  50.                         menus = menus + i + ",";
  51.                     }
  52.                 }
  53.             }
  54.             if(flag == "0")
  55.             {
  56.                 alert("請至少選擇一個選單");
  57.                 return false;
  58.             }
  59.             
  60.             var dir_edit = "";
  61.             for(var i=0; i<1000; i++)
  62.             {
  63.                 if(document.getElementById("rb"+i+"_1")!=null)
  64.                 {
  65.                     if(document.getElementById("rb"+i+"_1").type=="radio")
  66.                     {
  67.                         if(document.getElementById("rb"+i+"_1").checked)
  68.                         {
  69.                             var value = document.getElementById("rb"+i+"_1").value.substring(4,document.getElementById("rb"+i+"_1").value.length);
  70.                             dir_edit = dir_edit + value + ";";
  71.                         }
  72.                     }
  73.                 }
  74.             }
  75.             document.all.DirEdit.value = dir_edit.substring(0,menus.length-1);
  76.             document.all.Menus.value=menus.substring(0,menus.length-1);
  77.             return true;
  78.         }
  79.     </script>
  80. </head>
  81. <body>
  82.     <form id="form1" runat="server">
  83.     <div>
  84.     <center>
  85.         <br />
  86.         <asp:Label ID="LblName" runat="server" Style="position: relative" Text="權限群組名稱: "></asp:Label>
  87.         <asp:TextBox ID="TxtName" runat="server" Style="position: relative"></asp:TextBox>
  88.         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtName"
  89.             ErrorMessage="名稱不能為空" Style="position: relative"></asp:RequiredFieldValidator>
  90.         <br /></center>
  91.         <asp:HiddenField ID="MaxDir" runat="server" />
  92.         <input id="DirEdit" runat="server" type="hidden" />
  93.         <input id="Menus" runat="server" type="hidden" />
  94.         <asp:Panel ID="PnlOa" runat="server" Width="900px" Font-Bold="True" BackColor="#EFEFEF">
  95.             </asp:Panel>
  96.         <br />
  97.         <asp:Panel ID="PnlKm" runat="server" Width="900px" Font-Bold="True" BackColor="#EFEFEF">
  98.             </asp:Panel>
  99.         <br />
  100.         <center>
  101.         <asp:Button ID="BtnOk" runat="server" Text="儲存" OnClick="BtnOk_Click" OnClientClick="return sum()" />
  102.         </center>
  103.     </div>
  104.     </form>
  105. </body>
  106. </html>