Exemple #1
0
        /// <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));
        }
Exemple #2
0
        public ActionResult <object> ModifyDict([FromForm] CrmDictEntity dict)
        {
            var isok = _repository.ModifyDict(dict);

            if (isok)
            {
                _cache.Remove(_allDictKey);
            }
            return(isok.ResponseSuccessFailure());
        }
Exemple #3
0
        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());
        }
Exemple #4
0
 /// <summary>
 /// 修改数据
 /// </summary>
 /// <param name="dict"></param>
 /// <returns></returns>
 public bool ModifyDict(CrmDictEntity dict)
 {
     return(_service.Update(dict));
 }