Help

I recently left the sunroof cracked on my 2010 ml350 during a rainstorm which caused my passenger seat to get soaked which leaked thru to the battery and cpu Sam? module underneath. I was made aware of this because while driving the car died. I was able to restart and continue driving but my rear windows became locked in the down position and my headlights won't turn off among a few other issues that happened because the lights eventually drained the battery. What can I do to get my windows up and lights off so I can charge my battery