public ActionResult Approves(string strIds, ListAccounts 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.Approve(intId); if (result.Code == 1) { successCount += 1; } else { errorCount += 1; } } } } result.CodeText = "审核成功" + successCount + "个会员,失败" + errorCount + "个"; return(Json(result)); }
public ActionResult Approve(int id, ListAccounts request) { request.Approve(id); return(List(request)); }