  We have studied the electron-phonon and superconducting properties of the
Mg{1-x}AlxB2 and MgB{2(1-y)}C{2y} alloys within the framework of density
functional theory using the self-consistent virtual-crystal approximation. For
both alloys, the Eliashberg spectral functions and the electron-phonon coupling
constants have been calculated in the two-band model for several concentrations
up to x(Al)=0.55 and y(C)=0.175. We solved numerically the two-band Eliashberg
gap equations without considering interband scattering. Using a single
parameter for the Coulomb pseudopotential, which was determined for the undoped
compound, we were able to reproduce the experimental doping dependence of
Delta_sigma, Delta_pi, and T_c for both alloys on a quantitative level. In
particular, the observed differences in the doping range of superconductivity
between Al and C doping indicate a pronounced influence of the doping site,
which can be explained naturally in the present approach without the need to
invoke interband scattering, suggesting that this factor plays only a minor
role.
