it sounds like the power supply unit has died. First thing to do is unplug from the mains and open the case to check that the power plugs from the psu have not worked loose. Then double check that the mains cable is live by perhaps swapping it with the monitor mains cable. Random shutdowns could indicate that the system is overheating possibly a fan has died. If the cpu fan slows down the cpu will switch the pc off to stop it burning out. When cool it does allow the system to switch on again. Try and borrow another power supply from somewhere if not a new one can be had for about £20 far less than a mobo.