It sounds like your machine should work, you just need to re-attach the wires that came loose. I doubt there's more damage than that, if it wasn't under power when they were disturbed. The thing to do is figure out which wires are detached, and where they should go. If you could post some pictures showing exactly what's come loose from where, and perhaps a schematic of your system, it's likely someone here could help you get it back to working condition. If you want to start replacing things anyway, I'd suggest getting it to work as-is first, if possible.