Are you saying that the built in charging circuitry for your MacBook is defective? The DC input board might be defective but can be easily replaced. See the procedure at www.ifixit.com.
If you already replaced the DC input board and the charging circuitry is still not working, that leaves either the battery itself or the logic board. Replacing the battery can be expensive and a new logic board even more expensive.