public JsonResult Add(T_Role model) { bool Success = false; string Message = "添加失败请联系管理员!"; if (iRole.Add(model) > 0) { Success = true; Message = "成功"; } return Json(new { Success = Success, Message = Message }, JsonRequestBehavior.AllowGet); }
public JsonResult Update(T_Role model) { bool Success = false; string Message = "修改失败请联系管理员!"; if (model.IsDefault.ToString().Equals("on")) { model.IsDefault = 1; } else { model.IsDefault = 0; } int result = iRole.Edit(model); if (result > 0) { Success = true; Message = "成功"; } return Json(new { Success = Success, Message = Message }, JsonRequestBehavior.AllowGet); }