<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Organization_List.aspx.cs"
    Inherits="RM.Web.RMBase.SysOrg.Organization_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("Organization_Form_t")%></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/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 Organization_ID = '';
        function GetClickTableValue() {
            $('table tr').not('#td').click(function () {
                $(this).find('td').each(function (i) {
                    if (i == 9) {
                        Organization_ID = $(this).text();
                    }
                });
            });
            $("#dnd-example").treeTable({
                initialState: "expanded" //collapsed 收缩 expanded展开的
            });
        }
        //新增
        function add() {
            var url = "/RMBase/SysOrg/Organization_Form.aspx?ParentId=" + Organization_ID;
            top.openDialog(url, 'Organization_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form")%>', 800, 335, 50, 50);
        }
        //编辑
        function edit() {
            var key = Organization_ID;
            if (IsEditdata(key)) {
                var url = "/RMBase/SysOrg/Organization_Form.aspx?key=" + key;
                top.openDialog(url, 'Organization_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form")%>', 800, 335, 50, 50);
            }
        }
        //删除
        function Delete() {
            var key = Organization_ID;
            if (IsDelData(key)) {
                var isExistparm = 'action=IsExist&tableName=Base_Organization&clName=Organization_ID&pkName=ParentId&pkVal=' + key;
                var result = IsExist_Data('/Ajax/Common_Ajax.ashx', isExistparm, "type");
                var delparm;
                if (result && result.length > 0) {
                    delparm = 'action=Virtualdelete&module=<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_List")%>&tableName=Base_Organization&pkName=Organization_ID&pkVal=' + (result += ('' + key));
                    delConfig('/Ajax/Common_Ajax.ashx', delparm, '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Menu_List_sj")%>');
                } else {
                    delparm = 'action=Virtualdelete&module=<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_List")%>&tableName=Base_Organization&pkName=Organization_ID&pkVal=' + key;
                    delConfig('/Ajax/Common_Ajax.ashx', delparm);
                }

            }
        }
        //分配成员
        function allotMember() {
            var key = Organization_ID;
            if (IsDelData(key)) {
                var url = "/RMBase/SysOrg/Organization_AddUser.aspx?ParentId=" + Organization_ID;
                window.location.href = url;
            }
          
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_t")%>
        </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: 120px; padding-left: 20px;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_jigou")%>
                    </td>
                    <td style="width: 50px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_no")%>
                    </td>
                    <td style="width: 100px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_zhuzeren")%>
                    </td>
                    <td style="width: 100px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_waixian")%>
                    </td>
                    <td style="width: 100px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_neixian")%>
                    </td>
                    <td style="width: 100px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_chuanzhen")%>
                    </td>
                    <td style="width: 50px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Organization_Form_quhao")%>
                    </td>
                    <td style="width: 50px; text-align: center;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Button_Form_shunxu")%>
                    </td>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Menu_Form_ljdz")%>
                    </td>
                </tr>
            </thead>
            <tbody>
                <%=str_tableTree.ToString()%>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>
