/// <summary> /// 获取单个实体 /// </summary> /// <param name="keyValue"></param> /// <returns></returns> public ActionResult GetFormJson(string keyValue) { try { SafetyScoreEntity entity = _bll.GetEntity(keyValue); return(ToJsonResult(entity)); } catch (Exception ex) { return(ToJsonResult(ex)); } }
public ActionResult SaveForm(string keyValue, SafetyScoreEntity entity) { Operator user = OperatorProvider.Provider.Current(); WriteLog.AddLog($"用户:{user.UserName} id:{user.UserId}开始编辑积分管理数据{keyValue} \r\n {JsonConvert.SerializeObject(entity)}", "SafetyScore"); try { _bll.SaveForm(keyValue, entity); return(Success("操作成功")); } catch (Exception ex) { WriteLog.AddLog($"错误 \r\n用户:{user.UserName} id:{user.UserId}编辑积分管理数据{keyValue}失败 \r\n 错误信息:{JsonConvert.SerializeObject(ex)}", "SafetyScore"); return(Error(ex.Message)); } }
/// <summary> /// 保存 ,当用户Id为多个的时候,会新增多条 。 /// 多用户时用逗号隔开 /// </summary> /// <param name="keyValue"></param> /// <param name="entity"></param> /// <returns></returns> public void SaveForm(string keyValue, SafetyScoreEntity entity) { _scoreService.SaveForm(keyValue, entity); }