<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SimonMasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Html.Language("SystemSettings")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false" style="overflow: hidden; height: 30px;">
            <div class="toolbar">
                <a href="javascript:void(0)" class="toolbar-button tb-icon-refresh" onclick="$('#dg').propertygrid('reload')">
                    <%: Html.Language("Refresh")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-save"
                        onclick="saveData()">
                        <%: Html.Language("Save")%></a>
            </div>
        </div>
        <div data-options="region:'center',border:false">
            <table id="dg" class="easyui-propertygrid" data-options="
					url:'/SysSetting/LoadAll/',
					fit:true,
					border:false,
					showGroup:true,
					scrollbarSize:0,
					fitColumns: false,
					columns: [[
    					{ field:'remark', title:'<%: Html.Language("Option")%>', width:140, sortable:true,resizable:false },
						{ field:'value', title:'<%: Html.Language("Value")%>', width:200, resizable:false }
					]]
					">
            </table>

        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        function saveData() {

            var data = $('#dg').propertygrid('getData');

            var params = {};

            $.each(data.rows, function (i, n) {
                params[n.name] = n.value;
            });

            $.tools.confrimPost(lang.EnterToSaveTheSystemSettings, { jsonData: JSON.stringify(params) }, "/SysSetting/Save/");
        }
    </script>
</asp:Content>
