private static void Delete(Project toDelete) { ProjectRepo.Remove(toDelete); foreach (var employee in RelationProjectEmployeeRepo.GetEmployeesOnProject(toDelete.Name)) { RelationProjectEmployeeRepo.Remove(RelationProjectEmployeeRepo.GetRelation(employee.Oib, toDelete.Name)); } }
private void RemoveUncheckedEmployees() { foreach (var employeeItem in EmployeeListBox.Items) { if (EmployeeListBox.CheckedItems.Contains(employeeItem)) { continue; } if (RelationProjectEmployeeRepo.IsEmployeeOnProject(employeeItem.ToString().GetOib(), OldName)) { RelationProjectEmployeeRepo.Remove( RelationProjectEmployeeRepo.GetRelation(employeeItem.ToString().GetOib(), OldName)); } } }