<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RunningNumberRule.aspx.cs" Inherits="Base_RunningNumberRule_RunningNumberRule" %>
<%@ Register Src="~/Scripts/AWGridRuntime/UserControl/ListHeader.ascx" TagPrefix="uc1" TagName="ListHeader" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <uc1:ListHeader runat="server" ID="ListHeader" />
</head>
<body onload="search_grid()">
    <script type="text/javascript">
        var module_code = "";
        function search_grid() {
            var fb = document.getElementById("frame_box");
            var url = "RunningNumberRule_Edit.aspx?module_code=" + module_code;
            fb.src = url;
        }
        function save() {
            if (category == "") {
                AlertNO("请先选择模块!");return;
            }
            var fb = document.getElementById("frame_box");
            var cw = fb.contentWindow;
            var s = cw.document.getElementsByName("chk");
            var val="";
            for(var i=0;i<s.length;i++){
                if (s[i].checked) {
                    val += s[i].value + ",";
                }
            }
            if(val != ""){
                val = val.substring(0,val.length-1);
            }
            
            ShowLoadingMask(); //显示遮罩
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: "../GiveAuthority/GiveAuthority_Service.asmx/Save",
                data: "{type:'" + type + "',module:'" + category + "',id:" + id + ",val:'" + val + "'}",
                dataType: 'json',
                success: function (result) {
                    var r = result.d;
                    if (r == "success") {
                        AlertOK('保存成功!');
                        //search_grid();
                    } else {
                        AlertNO(r);
                    }
                    HideLoadingMask(); //关闭遮罩
                }
            });
            
        }
    </script>
    <iframe id="frame_tree" frameborder="0" style="width:30%;height:97%" src="RunningNumberRule_Tree.aspx"></iframe>
    <iframe id="frame_box" frameborder="0" style="width:69%;height:97%"></iframe>
</body>
</html>
