Beispiel #1
0
 public bool DeleteDepartment(long id)
 {
     return(doInTransaction(
                () => {
         var employees = employeeRepository.FindByDepartmentIds(new List <long> {
             id
         });
         if (employees.Count != 0)
         {
             throw BusinessException.CannotDeleteDepartmentWithEmployees(
                 id,
                 employees
                 );
         }
         return departmentRepository.Delete(id) != 0;
     }
                ));
 }