<%@ Page Title="" Language="C#" MasterPageFile="~/Styles/MasterPage/MasterPage_Edit.master" AutoEventWireup="true" CodeFile="CurrencyRate_Edit.aspx.cs" Inherits="Base_Currency_CurrencyRate_Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        var action = '<%=xview["action"]%>';
        var crc_id = '<%=Request["crc_id"].ToString() %>';
        function Save() {
            <%=xview["Script_GetInput"] %>
            var action = '<%=xview["action"]%>';
            parent.ShowLoadingMask(); //显示遮罩
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: 'CurrencyRate_Service.asmx/Save',
                data: "{action:'" + action + "',<%=xview["Script_SaveJSON"]%>}",
                dataType: 'json',
                success: function (result) {
                    parent.HideLoadingMask(); //关闭遮罩
                    var r = result.d;
                    if (r == "success") {
                        parent.AlertOK('保存成功!');
                        parent.search_grid();
                        CloseDivWin(); //关闭窗口
                    } else {
                        parent.AlertNO(r);
                    }
                }
            });
        }
    </script>
    <!--工具栏-->
    <div class="list_menu_bar">
        <a plain="true" class="easyui-linkbutton" iconcls="icon-save" onclick="Save()" style='<%=auth.AuthView("Base_Currency_Edit")%>'>保存</a>
        <a plain="true" class="easyui-linkbutton" onclick="parent.DesignModuleFormat('Base_CurrencyRate_Input');CloseDivWin();" style='<%=auth.FormatView()%>'>格式</a>
    </div>
    <div style="width:350px;height:200px;overflow:hidden;">
        <div class="edit_area">
        <%=xview["input_ui"]%>
        </div>
    </div>
    <script type="text/javascript">
        //初始化页面
        function init_page() {
            <%if(action.Equals("Update")){ %>
                $F("crc_year").disabled = true;
                $F("crc_month").disabled = true;
            <%}else{ %>
                $F("crc_id").value = crc_id;
                $F("crc_year").value = '<%=xview["crc_year"]%>';
                $F("crc_month").value = '<%=xview["crc_month"]%>';
                $F("exchange_rate").value = "1";
            <%} %>
        }
        init_page();

    </script>
</asp:Content>

