public HttpResponseMessage DelTaskType(int id) { try { var cond = new TaskSearchCondition() { typeId = id }; int tlistcout = _taskService.GetTaskCount(cond); if (tlistcout > 0) { return(PageHelper.toJson(PageHelper.ReturnValue(false, "该类型使用中,删除失败"))); } else { _taskTypeService.Delete(_taskTypeService.GetTaskTypeById(id)); return(PageHelper.toJson(PageHelper.ReturnValue(true, "删除成功"))); } } catch (Exception) { return(PageHelper.toJson(PageHelper.ReturnValue(false, "删除失败"))); } }
public async Task <ActionResult <bool> > Delete(int id) { return(Ok(await _taskTypeService.Delete(await GetUserId(), id, GetPermissionId()))); }