public void DeleteCategory(CategoryDO category)
        {
            List <TaskDO> tasks = taskDAO.ReadAllByCategoryId(category.CategoryId);

            if (tasks.Any(t => t.Status != TaskStatus.TaskComplete))
            {
                throw new ValidationException("Category contains active tasks!");
            }
            else
            {
                categoryDAO.Delete(category);
            }
        }
Esempio n. 2
0
 public void Delete(CATEGORY Category)
 {
     _categoryDAO.Delete(Category);
     Context.SaveChanges();
 }