src/Model/Inventory.java
// Checks to see whether part can be deleted or not (checks whether part is associated with any products)
Checks to see whether part can be deleted or not (checks whether part is associated with any products)
Checks to see whether part can be deleted or not ( checks whether part is associated with any products )
public static boolean deletePartCheck(Part selectedPart) {
        boolean okayToDeletePart = true;
        for (int i = 0; i < allProducts.size(); i++) {
            if (allProducts.get(i).getAllAssociatedParts().contains(selectedPart)) {
                okayToDeletePart = false;
            }
        }
        return okayToDeletePart;
    }
public static boolean deletePartCheck ( Part selectedPart ) { boolean okayToDeletePart = true ; for ( int i = 0 ; i < allProducts . size ( ) ; i ++ ) { if ( allProducts . get ( i ) . getAllAssociatedParts ( ) . contains ( selectedPart ) ) { okayToDeletePart = false ; } } return okayToDeletePart ; }
Checks to see whether part can be deleted or not (checks whether part is associated with any products)
Checks to see whether part can be deleted or not ( checks whether part is associated with any products )