A quasi-atomic treatment of chemical and structural effects on K-shell excitations in hexagonal and cubic BN crystals