Esempio n. 1
0
        public bool DeleteById(Guid id)
        {
            var deleted = this.FindById(id);

            if (deleted == null)
            {
                return(false);
            }
            var flag = _repository.DeleteById(id);

            return(flag);
        }
Esempio n. 2
0
 public void DeleteForm(string keyValue)
 {
     if (service.IQueryable().Count(t => t.ParentId.Equals(keyValue)) > 0)
     {
         throw new Exception("删除失败!操作的对象包含了下级数据。");
     }
     else
     {
         service.DeleteById(t => t.Id == keyValue);
     }
     //添加日志
     LogHelp.logHelp.WriteDbLog(true, "删除菜单信息=>" + keyValue, Enums.DbLogType.Delete, "菜单管理");
 }