/// <summary> /// 添加数据 /// </summary> /// <param name="dict"></param> /// <returns></returns> public bool AddDict(CrmDictEntity dict) { var count = _service.FindCountByFunc <CrmDictEntity>(t => t.DictType == dict.DictType && t.DictKey == dict.DictKey); if (count > 0) { return(false); } return(_service.Insert(dict)); }
public ActionResult <object> ModifyDict([FromForm] CrmDictEntity dict) { var isok = _repository.ModifyDict(dict); if (isok) { _cache.Remove(_allDictKey); } return(isok.ResponseSuccessFailure()); }
public ActionResult <object> AddDict([FromForm] CrmDictEntity dict) { var isok = _repository.AddDict(dict); if (isok) { _cache.Remove(_allDictKey); } else { return(false.ResponseDataError("添加的所属分类+key值已经存在")); } return(true.ResponseSuccessFailure()); }
/// <summary> /// 修改数据 /// </summary> /// <param name="dict"></param> /// <returns></returns> public bool ModifyDict(CrmDictEntity dict) { return(_service.Update(dict)); }