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

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <uc1:ListHeader runat="server" ID="ListHeader" />
    <script type="text/javascript">
        //搜索
        function search_grid() {
            var fg = document.getElementById("frame_grid");
            var cm_year = $("#cm_year").val();
            var url = "BusinessEnd_Grid.aspx?cm_year=" + cm_year;
            
            fg.src = url;
        }
        //选择打印模板
        function grf_print(){
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            choice_print_template('<%=xview["auth_code"]%>',"",cw.sql_print_detail_session_id);
        }
        //月结
        function close_month(action) {
            var title = "月结";
            if (action == 'CloseMonth_UnDo') {
                title = "取消月结";
            }
            asyncbox.confirm('确定要' + title + '吗?', '警告', function (buttonResult) {
                if (buttonResult == "ok") {
                    ShowLoadingMask(); //显示遮罩
                    $.ajax({
                        type: "POST",
                        contentType: "application/json",
                        url: 'BusinessEnd_Service.asmx/' + action,
                        data: "{}",
                        dataType: 'json',
                        success: function (result) {
                            HideLoadingMask(); //关闭遮罩
                            var r = result.d;
                            if (r == "success") {
                                AlertOK(title + "完毕!");
                                search_grid();
                            } else {
                                AlertNO(r);
                            }
                        }
                    });
                }
            });
        }
        function modify() {}
    </script>
</head>
<body>
    <!--工具栏-->
    <div style="height:30px;" class="list_menu_bar">
        当前年份：
        <select id='cm_year' onchange='search_grid()'>
            <%=xview["options_year"]%>
        </select>
        <input type='button' class="SiteButton" id="btn_do" onclick="close_month('CloseMonth')" style='<%=auth.AuthView("System_BusinessEnd")%>' value='月结'/>
        <input type='button' class="SiteButton" id="btn_undo" onclick="close_month('CloseMonth_UnDo')" style='<%=auth.AuthView("System_BusinessEnd")%>' value='取消'/>
    </div>
    <!--Grid控件所在的iframe-->
    <%=xview["grid_frame"]%>
    <script type="text/javascript">
        $(document).ready(function () {
            search_grid();
        });
    </script>
</body>
</html>
