日期:2014-05-17 浏览次数:20676 次
function saveIndex() {
        if ($('#fm').valid()) {
            $.post(url, $("#fm").serialize() + '&' + $("#fm").serializeDisabled(), function (result) {
                if (result.success) {
                    $.messager.alert('提示', '数据已保存!');
                    javascript: $('#dlg').dialog('close')
                    $('#dg').datagrid('reload'); // 刷新数据
                } else {
                    $.messager.alert('提示', '数据保存出现错误!', 'error');
                }
            }, 'json');
        }
    }
/// <summary>
        /// 新建-保存
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Create(Index index)
        {
            try
            {
                IndexRepository.Insert(index);
                return Json(new { success = true });
            }
            catch (Exception e)
            {
                return Json(new { msg = "服务出现错误." });
            }
        }