Theory of superconductivity for transition-metal alloys