public JsonResult SaveValueSet(string valueSetJson) { bool state = true; string msg = string.Empty; ValueSet.Entity.ValueSetEntity entity = ValueSet.Service.ValueSetService.SaveValueSet(valueSetJson, out state, out msg); if (string.IsNullOrEmpty(msg)) { msg = "增加成功"; } return(new JsonResult { Data = new { state = state, msg = msg, data = entity } }); }
// Get: 根据id获取值集 public JsonResult GetValueSetById(string id) { bool state = true; string msg = string.Empty; ValueSet.Entity.ValueSetEntity entity = null; try { entity = ValueSet.Entity.ValueSetEntity.GetSingle(id); } catch (Exception e) { state = false; msg = e.Message; } return(new JsonResult { Data = new { state = state, msg = msg, data = entity }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }