public ActionResult Deletes(string strIds, ListRoles request) { ResultMsg result = new ResultMsg(); int successCount = 0; int errorCount = 0; if (!string.IsNullOrEmpty(strIds)) { string[] sId = strIds.Split(','); foreach (var id in sId) { int intId = 0; if (int.TryParse(id, out intId)) { result = request.Delete(intId); if (result.Code == 1) { successCount += 1; } else { errorCount += 1; } } } } result.CodeText = "删除成功" + successCount + "个角色,失败" + errorCount + "个"; return(Json(result)); }
public ActionResult Delete(int id, ListRoles request) { return(Json(request.Delete(id))); }