This was really a hack installation for sure! Nothing, but nothing was done right. There are 2 ways to run a DW drain hose. The way that is legal under all codes is the air gap. Some areas allow a high loop where the hose is looped above the level of the DW before going to the drain. After that, there are 2 ways to connect the drain hose. If you have a disposal, the hose connects to it. If you do not have a disposal, then you use a special Y connector prior to the P trap. In either case, the hose is attached prior to the P trap. I would remove whatever connection there is now to the drain as it will never be legal. As far as the water line is concerned, again it is unbelievable that even a raw beginner would connect a DW without a shutoff valve. If it was my house, I'd put a 1/4 turn shutoff valve in right now and have it done with. I do not have a suggestion on just how to make the connections without seeing exactly what you have. It might be possible to use compression fittings where soldering would be difficult. I would make every effort to avoid Sharkbites. You may want to look at some revisions in how the pipes are run, but again, without seeing the mess you have, it's pretty hard to get specific.