public ActionResult Suspends(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.Suspend(intId); if (result.Code == 1) { successCount += 1; } else { errorCount += 1; } } } } result.CodeText = "停用成功" + successCount + "个角色,失败" + errorCount + "个"; return(Json(result)); }
public ActionResult Suspend(int id, ListRoles request) { return(Json(request.Suspend(id))); }