Interplay of charge density wave and multiband superconductivity in layered quasi-two-dimensional materials: The case of 2H−NbS2 and 2H−NbSe2