That would be the first suspect, followed by the battery. If those aren't the problem, you have a mainboard issue.
If the power supply is OK and the battery is new (and OK), you have a faulty system board.
I have an inspiron e1405 dell replaced the power cord twice, replaced the mother board, and replaced the battery. the last of the repairs finished after it was out of warrenty. It worked for about 2 weeks and now back to plugged in not charging. Occassionaly the battery will charge but it is rare. Not sure what the problem is maybe the mother board bad AGAIN who knows, sometimes it says some message about being the wrong power adapter when I boot up the computer but sometimes it doesnt.
I have 2 dell laptops a dell e1705 never any problems (spent a pretty penny on that one) and the e1405 which was the cheapest one they had, and I have had nothing but problems with it. Dell does not care they say it is out of warrenty. Since it was new we have had to use it as a desktop no mobility.
I probably wont ever buy another dell, but if for some reason I decide to buy another I wont go for the cheap one, they seem to have the most problems