Mercedes-Benz 2000 1998 - working perfectly then door would not open - rosie01

My Mercedes 2000e 1998 was perfect the previous evening the next morning I pressed the key fob to open the door and it wouldn't open so I entered the car manually via the passenger door but the engine was completely dead. I left it 5 mins and tried again. it worked as normal. went shopping and it started normally to get home. no signs of a flat battery. The next day the door wouldn't open again and the engine was completely dead so I purchased a new battery and also new batteries for the key fob.All lights are working on the dash but engine still dead and door won't open with key fob.I would be very grateful if anyone has any ideas.

Many Thanks