Dirty connections somewhere maybe, but to me it sounds like a Alternator fault ???
Reason being is that when the car is running the battery just gets charged as the alternator takes over to supply power, if the battery was going out you wouldnt see it whilst the car was running, I once had a dead as battery, it would only start with a jump, but when it was running it was fine.
You may have killed the battery by running it dead.
Saying that Im not 100% on modern car electrics, with my old pre ECU cars you didnt even need a battery, park on a hill and clutch it, no problems, I do know that the new cars need a battery with some volts to let the ECU send signals to injectors and stuff.
Stick in a fresh battery from a mates car and see if it starts, if it does put a meter on it and see if it recieving volts, I think it should be around 13.5 volts (not 100% sure) or so when the car is running, if its not switch it off or you will drain your mates battery flat.