When training your dog to be in a crate either at night or when in a crate to travel it will take some time to get your dog used to being in the crate.
If you're going on a road trip or plane trip prepare your dog at least a month or so by placing them in the crate and taking them for a ride and try to tell them that if they're quiet they will get a treat.
Also by putting them in the crate before hand they'll realize that eventually they will get out of the crate and will overtime get used to being in the crate and stop crying inside the crate.
Dogs also cry in the crate because they're lonely or bored.
Give the dog something such as a treat or toy to play with while in the crate and make sure the crate is roomy enough for the dog to move around some without being cramped.
The dog will eventually get used to being inside the crate and stop crying after awhile but it will just take time.
Teach your dog only to whine when the dog needs to come out of the crate to potty and then right after the dog gets done you should put them back in the crate for the night or while traveling.