<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Role_List.aspx.cs" Inherits="RM.Web.RMBase.SysRole.Role_List" %>

<%@ Register Src="../../UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc1" %>
<!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><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/TreeTable/jquery.treeTable.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/TreeTable/css/jquery.treeTable.css" rel="stylesheet"
        type="text/css" />
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            divresize(63);
            FixedTableHeader("#dnd-example", $(window).height() - 91);
            GetClickTableValue();
        })
        /**
        获取table TD值
        主键ID
        column:列名
        **/
        var Roles_ID = '';
        var Roles_Name = '';
        function GetClickTableValue() {
            $('table tr').not('#td').click(function () {
                $(this).find('td').each(function (i) {
                    if (i == 8) {
                        Roles_ID = $(this).text();
                    }
                    if (i == 0) {
                        Roles_Name = $(this).text();
                    }
                });
            });
            $("#dnd-example").treeTable({
                initialState: "expanded" //collapsed 收缩 expanded展开的
            });
        }
        //新增
        function add() {
            var url = "/RMBase/SysRole/Role_Form.aspx?ParentId=" + Roles_ID;
            top.openDialog(url, 'Role_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form")%>', 600, 355, 50, 50);
        }
        //编辑
        function edit() {
            var key = Roles_ID;
            if (IsEditdata(key)) {
                var url = "/RMBase/SysRole/Role_Form.aspx?key=" + key;
                top.openDialog(url, 'Role_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form")%>', 600, 355, 50, 50);
            }
        }
        //删除
        function Delete() {
            var key = Roles_ID;
            if (confirm('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_List_del")%>')) {
                getAjax("DeleteRole.ashx", "key=" + key + "&role=role", function (rs) {
                    if (rs == "1") {
                        showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ass") %>', 5000, 4);
                        window.location.href = window.location.href;
                    }
                    else {
                        showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_List_delr") %>', 2000, 4);
                        window.location.href = window.location.href;
                    }
                    
                });
            }
        }

        //分配权限
        function allotAuthority() {
            var key = Roles_ID;
            if (IsEditdata(key)) {
                var url = "/RMBase/SysRole/AllotAuthority_Form.aspx?key=" + key + '&Roles_Name=' + escape(Roles_Name);
                Urlhref(url);
            }
        }
        //详细信息
        function detail() {
            var key = Roles_ID;
            if (IsEditdata(key)) {
                var url = "/RMBase/SysRole/Role_Info.aspx?key=" + key + '&Roles_Name=' + escape(Roles_Name);
                Urlhref(url);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="float: left;">
        </div>
        <div style="text-align: right">
            <uc1:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div class="div-body">
        <table class="example" id="dnd-example">
            <thead>
                <tr>
                    <td style="width: 180px; padding-left: 20px;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role")%>
                    </td>
                    <td style="width: 60px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_List_sate")%>
                    </td>
                    <td style="width: 60px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Button_Form_shunxu")%>
                    </td>
                    <td style="width: 120px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CreateUser")%>
                    </td>
                    <td style="width: 120px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_CreatDate")%>
                    </td>
                    <td style="width: 120px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ModifyUser")%>
                    </td>
                    <td style="width: 120px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ModifyTime")%>
                    </td>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CurrentUserManager_jsms")%>
                    </td>
                </tr>
            </thead>
            <tbody>
                <%=str_tableTree.ToString()%>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>
