<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PermissionsEdit.aspx.cs" Inherits="ComResProSystem.PermissionsEdit" %>

<!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 type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
            font-size: 12px;
        }
        .table
        {
            border-collapse: collapse;
            height: 24px;
            line-height: 24px;
            text-align: center;
        }
        .table tr
        {
            border-right: solid 1px #FFF;
            border-left: solid 1px #000000;
        }
        .table tr td
        {
            border: solid 1px #000000;
        }
        .classtd
        {
            background-image: url(Image/tab/tab_14.gif);
            height: 26px;
            background-repeat: repeat-x;
            text-align: center;
        }
    </style>
    <script type="text/javascript">
        function checkall() {
            var objmail = document.getElementById("per");
            var obj = objmail.getElementsByTagName("input");
            var check = document.getElementById("ck_all");
            if (check.checked) {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = true;
                    }
                }
            }
            else {
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].type == "checkbox") {
                        obj[i].checked = false;
                    }
                }
            }
            document.getElementById("ck_rechoice").checked = false;
        }
        function rechoice() {
            var objmail = document.getElementById("per");
            var obj = objmail.getElementsByTagName("input");
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].type == "checkbox") {
                    obj[i].checked = !obj[i].checked;
                }
            }
            document.getElementById("ck_all").checked = false;
        }
        function checkdel() {
            var bool = false;
            var objmail = document.getElementById("per");
            var obj = objmail.getElementsByTagName("input");
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].type == "checkbox") {
                    if (obj[i].checked) {
                        bool = true;
                        break;
                    }
                }
            }
            if (!bool) {
                alert('请选择删除项！');
            }
            else {
                return confirm('您确定要执行本次操作？');
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div style="background-image: url(Image/tab/tab_05.gif); height: 25px; background-repeat: repeat-x">
            <img src="Image/tab/311.gif" alt="" /><span style="font-size: 12px; color: #1F4A65;
                font-weight: bold;">权限管理编辑</span>
        </div>
        <div>
             <asp:Repeater ID="Rp_Permission" runat="server">
                    <HeaderTemplate>
                        <table id="per" class="table" cellpadding="0px" cellspacing="0px" width="50%" style="margin-top: 10px"
                            align="center">
                            <tr>
                                <td class="classtd">
                                选择
                                </td>
                                <td class="classtd">
                                    编号
                                </td>
                                <td class="classtd">
                                    权限名称
                                </td>
                                <td class="classtd">
                                    描述
                                </td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <asp:CheckBox ID="Ck_Check" runat="server" />
                            </td>
                            <td style=" display:none">
                                <asp:Label ID="Lb_ID" runat="server" Text='<%#Eval("ID")%>'></asp:Label>
                            </td>
                            <td>
                                <%#Container.ItemIndex+1 %>
                            </td>
                            <td>
                                <%#Eval("NodeText")%>
                            </td>
                            <td>
                                <%#Eval("NodeDes")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                      
                       </table>
                       
                         
                    </FooterTemplate>
                </asp:Repeater>
                 <div style=" width:50%; margin:0px auto" align="center">
                       <div style=" width:100px; float:left;">
                       <input id="ck_all" type="checkbox" onclick="checkall()"/>全选
                       <input id="ck_rechoice" type="checkbox" onclick="rechoice()" />反选
                       </div>
                        <asp:ImageButton ID="Itb_Submit" runat="server" 
                           ImageUrl="~/Image/Bt_Submit.gif" OnClientClick="return checkdel()" 
                           onclick="Itb_Submit_Click" style="height: 18px" />
                       </div>
        </div>
    </div>
    </form>
</body>
</html>
