<%@ page language="C#" autoeventwireup="true" inherits="system_jueseedit, putonggan_deploy" %>

<!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 id="Head1" runat="server">
    <title></title>
     <style type="text/css">

.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {
	color: #03515d;
	font-size: 12px;
}
        
        a:link                       {font-size: 9pt;color: #2F6589; text-decoration: none;}
         .style1
         {
             color: #03515d;
             font-size: 12px;
         }
         .style2
         {
             color: #03515d;
             font-size: 12px;
             height: 21px;
         }
         .style3
         {
             height: 21px;
         }
         .style4
         {
             color: #03515d;
             font-size: 12px;
             width: 739px;
         }
         .style5
         {
             height: 12px;
         }
         .style6
         {
             font-size: 12px;
             height: 12px;
         }
         </style>

    <link href="../css/common.css" rel="stylesheet" type="text/css" />
    <link href="../css/Default.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function Checkbox1_onclick() {
            for (var i = 0; i < document.getElementById("userid").getElementsByTagName("input").length; i++) {
                var objCheck = document.getElementById("userid_" + i);
                if (objCheck.checked)
                    objCheck.checked = false;
                else
                    objCheck.checked = true;
            }
        }
        function public_GetParentByTagName(element, tagName) {
            var parent = element.parentNode;
            var upperTagName = tagName.toUpperCase();
            //如果这个元素还不是想要的tag就继续上溯
            while (parent && (parent.tagName.toUpperCase() != upperTagName)) {
                parent = parent.parentNode ? parent.parentNode : parent.parentElement;
            }
            return parent;
        }

        //设置节点的父节点Cheched——该节点可访问，则他的父节点也必能访问 
        function setParentChecked(objNode) {
            var objParentDiv = public_GetParentByTagName(objNode, "div");
            if (objParentDiv == null || objParentDiv == "undefined") {
                return;
            }
            var objID = objParentDiv.getAttribute("ID");
            objID = objID.substring(0, objID.indexOf("Nodes"));
            objID = objID + "CheckBox";
            var objParentCheckBox = document.getElementById(objID);
            if (objParentCheckBox == null || objParentCheckBox == "undefined") {
                return;
            }
            if (objParentCheckBox.tagName != "INPUT" && objParentCheckBox.type == "checkbox")
                return;
            objParentCheckBox.checked = true;
            setParentChecked(objParentCheckBox);
        }

        //设置节点的子节点uncheched——该节点不可访问，则他的子节点也不能访问 
        function setChildUnChecked(divID) {
            var objchild = divID.children;
            var count = objchild.length;
            for (var i = 0; i < objchild.length; i++) {
                var tempObj = objchild[i];
                if (tempObj.tagName == "INPUT" && tempObj.type == "checkbox") {
                    tempObj.checked = false;
                }
                setChildUnChecked(tempObj);
            }
        }

        //设置节点的子节点cheched——该节点可以访问，则他的子节点也都能访问 
        function setChildChecked(divID) {
            var objchild = divID.children;
            var count = objchild.length;
            for (var i = 0; i < objchild.length; i++) {
                var tempObj = objchild[i];
                if (tempObj.tagName == "INPUT" && tempObj.type == "checkbox") {
                    tempObj.checked = true;
                }
                setChildChecked(tempObj);
            }
        }

        function CheckEvent() {

            var objNode = event.srcElement;

            if (objNode.tagName != "INPUT" || objNode.type != "checkbox")
                return;

            if (objNode.checked == true) {
                setParentChecked(objNode);
                var objID = objNode.getAttribute("ID");
                var objID = objID.substring(0, objID.indexOf("CheckBox"));
                var objParentDiv = document.getElementById(objID + "Nodes");
                if (objParentDiv == null || objParentDiv == "undefined") {
                    return;
                }
                setChildChecked(objParentDiv);
            }
            else {
                var objID = objNode.getAttribute("ID");
                var objID = objID.substring(0, objID.indexOf("CheckBox"));
                var objParentDiv = document.getElementById(objID + "Nodes");
                if (objParentDiv == null || objParentDiv == "undefined") {
                    return;
                }
                setChildUnChecked(objParentDiv);
            }
        }</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" 
          background="../images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30">
            <img src="../images/tab_03.gif" 
                width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%" class="style5"><div align="center">
                    <img src="../images/tb.gif" width="16" 
                        height="16" /></div></td>
                <td width="95%" class="style6"><span class="STYLE3">你当前的位置</span>：<asp:SiteMapPath 
                        ID="SiteMapPath1" runat="server">
                    </asp:SiteMapPath>
                  </td>
              </tr>
            </table></td>
            <td width="54%">&nbsp;</td>
          </tr>
        </table></td>
        <td width="16">
            <img src="../images/tab_07.gif" 
                width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" 
              background="../images/tab_12.gif">&nbsp;</td>
        <td>
    <div><asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate><table align="left" border="1" bordercolor="#C2E5FB" cellpadding="3" 
            cellspacing="1" style="border-collapse:collapse " width="99%">
            <tr>
                <td align="middle" class="style2">
                    排序号</td>
                <td align="left" class="style3">
                    <asp:TextBox ID="txtbianhao" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="middle" class="STYLE4" width="95">
                    角色名称</td>
                <td align="left" class="text_left" width="644">
                    <asp:TextBox ID="txtjuese" runat="server" Width="177px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtjuese" ErrorMessage="角色名称不能为空！"></asp:RequiredFieldValidator>
                    <asp:HiddenField ID="hfoldjuese" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="middle" class="STYLE4">
                    <span lang="zh-cn">权限</span></td>
                <td align="left" class="text_left">
                    <asp:RadioButtonList ID="rblqx" runat="server" RepeatDirection="Horizontal" 
                        RepeatLayout="Flow" onselectedindexchanged="rblqx_SelectedIndexChanged" AutoPostBack="True">
                        <asp:ListItem Value="1">超级管理员</asp:ListItem>
                        <asp:ListItem Selected="True" Value="0">普通用户</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr id="qx" runat="server">
                <td align="middle" class="STYLE4">
                    <span lang="zh-cn">菜单控制</span></td>
                <td align="left" class="text_left">
                    <asp:TreeView ID="TreeView1" runat="server" ShowCheckBoxes="All" 
                        ShowLines="True">
                    </asp:TreeView>
                </td>
            </tr>
            <tr>
                <td align="middle" class="style1">
                    用户</td>
                <td align="left">
                    <span lang="zh-cn"><input id="Checkbox1" type="checkbox" onclick="Checkbox1_onclick()" />全选/反选</span></td>
            </tr>
            <tr id="User">
                <td align="middle" class="STYLE4">
                    &nbsp;</td>
                <td align="left" class="text_left">
                    <asp:CheckBoxList ID="userid" runat="server" Width="641px" 
                        DataTextField="userxm" DataValueField="id" 
                        Height="16px" RepeatDirection="Horizontal" RepeatColumns="5">
                    </asp:CheckBoxList>
                </td>
            </tr>
            <tr>
                <td align="middle" class="STYLE4" width="95">
                    说明</td>
                <td align="left" class="text_left" width="644">
                    &nbsp;<asp:TextBox ID="txtshuoming" runat="server" Height="53px" TextMode="MultiLine" Width="330px"></asp:TextBox>
                </td>
            </tr>
            <tr align="center">
                <td class="style4" width="95" colspan="2">
                    <asp:HiddenField ID="tempid" runat="server" />
                    <asp:Button ID="Button1" runat="server" Text="修 改" onclick="Button1_Click" />
&nbsp;<input name="Submit2" type="reset" value="清 除" />
                    <input name="Submit3" onclick="javascript:history.go(-1);" type="button" 
                        value="返 回" />
                    <asp:Label ID="lblMsg" runat="server" Text=""></asp:Label>
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
                        AssociatedUpdatePanelID="UpdatePanel1">
                        <ProgressTemplate>
                            <asp:Image ID="images1" runat="server" ImageUrl="~/images/loading.gif" />
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                </td>
            </tr>
        </table>
    </div>
        </ContentTemplate>
            </asp:UpdatePanel>            
          </td>
        <td width="8" 
              background="../images/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="35" 
          background="../images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35">
            <img src="../images/tab_18.gif" 
                width="12" height="35" /></td>
        <td>&nbsp;</td>
        <td width="16">
            <img src="../images/tab_20.gif" 
                width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>

        

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