The electronic structures and superconductivity of a new superconducting perovskite material MgCNi3 are studied using MS-Xα calculation. In MgCNi3, the peak of density of states is located below the Fermi level, which is dominated by Ni d band. The electronic structures of MgCNi2T(T=Co,Mn,Cu) have been also investigated. It is confirmed that Co dopants in MgCNi3 behave as a source of d-band holes, and the suppression of superconductivity occurs faster for the Mn-doped case than for the Co-doped case. We study the effects of electron (Cu) doping on the superconductivity. It is found that both electron (Cu) doping and hole (Co, Mn) doping quench superconductivity. Comparing with the hole (Co) doping, we found that the suppression of superconductivity occurs faster for the Co-doped case than for the Cu-doped case.