public IActionResult SelectCondition([FromBody] RolePermissionTable role) { try { var table = _repository.LoadAll(); if (role.RoleTableId.HasValue) { table = table.Where(t => t.RoleTableId == role.RoleTableId); } return(Json(new { table = table.ToList(), state = "0", msg = "操作成功!" })); } catch (Exception ex) { return(Json(new { state = "-1", msg = "非法操作!" })); } }
public IActionResult Add([FromBody] RolePermissionTable role) { try { int id = _repository.SaveGetId(role); return(Json(new { id, state = "0", msg = "添加成功!" })); } catch (Exception ex) { return(Json(new { state = "-1", msg = "非法操作!" })); } }