日期:2014-05-18 浏览次数:20783 次
private string delete() { string sReturnJson = string.Empty; string Ids = ParamsofEasyUI.RequstString("id"); //string sqlexe = string.Format("delete from product where id in ({0})", id); //string a = "a"; if (AllService.DeleteFood(Ids)) //if (mdb.db.ExecuteUpdate(sqlexe)) sReturnJson = "{success:true}"; else sReturnJson = "{success:false,msg:'删除失败'}"; return sReturnJson; }
function del() { var arr = getSelectedArr(); if (arr.length > 0) { //$.messager.confirm('提示信息', '您确认要删除吗?', function(data) { //alert(data); //if (data) { $.ajax({ //url: 'Handler.ashx?action=del&id=' + arr2str(arr), url: '<%= Url.Content("~/Controllers/JsonBreakfast.ashx?action=del&id=")%>' + arr2str(arr), type: 'GET', timeout: 1000, error: function() { $.messager.alert('错误', '删除失败!', 'error'); }, success: function(data) { eval('data=' + data); if (data.success) { //grid.datagrid('acceptChanges'); grid.datagrid('reload'); //grid.datagrid('refreshRow'); grid.datagrid('clearSelections'); } else { $.messager.alert('错误', data.msg, 'error'); } } }); //grid.datagrid('deleteRow', index); //} //}); } else { $.messager.show({ title: '警告', msg: '请先选择要删除的记录。' }); } }