<%@ Page Language="C#" MasterPageFile="~/Views/Shared/MasterPage.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">
    <table id="dg" class="easyui-propertygrid" data-options="
			url: '/SysSetting/LoadAll/',
			toolbar: '#tb',
			fit: true,
			border: false,
			showGroup: true,
			scrollbarSize: 0,
			fitColumns: false,
			columns: [[
    				{ field:'remark', title:'<%: Html.Language("Name")%>', width:120, sortable:true },
						{ field:'value', title:'<%: Html.Language("Value")%>', width:200, resizable:false }
			]]
			">
    </table>
    <div id="tb">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
            onclick="$('#dg').propertygrid('reload')">
            <%: Html.Language("Refresh")%></a> <a href="javascript:void(0)" class="easyui-linkbutton"
                data-options="iconCls:'icon-save',plain:true" onclick="saveData()">
                <%: Html.Language("Save")%></a>
    </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>
