I am playing background piano music at a dinner tonight. It is the first time I have done this and I wonder if there are guidelines on the order of pieces or if I can just wildly mix fast and slow, major and minor, jazz and classical. Also are there maybe more advanced ways (based on tonality for example) to connect pieces seamlessly?
Can't tell you what sort of pieces in what order - that's partly down to intuition on the night: reading audience reaction (or not!) and doing more of the same or not as the case may be. But, segueing is not that difficult. Sometimes a number needs to come to a proper end, but since it's background stuff, what I do is try to keep the music going, by either moving straight from one song to the next, or using the 'mortar' of a few bars to change key - ii-V-I is an industry standard - or maybe playing the first couple of bars of the new song in the key of the last, and moving chromatically up/down the 3 or 4 semitones to the new key. Sometimes an abrupt stop is effective, in that those listening (and those not!) sense something has happened ('Did the piano player fall off his stool?') and suddenly you've gained a bit of attention. Why shouldn't you? I also may play a couple of bars of the new song, stop for a bar, do it again. A bit like 'Do you know what it is yet?' If you think a number is being well received, why not put an extra middle 8/chorus in? Likewise, cut something short if you feel it doesn't work 'in the moment'.
Good luck, and look as if you're enjoying yourself; it helps everyone else to enjoy it too.
Remember what your basic function is here - you are being paid (I presume!) to provide "elevator music", not play a concert. If you do something that makes the conversation fall silent because everybody is listening to you, that's bad.
Therefore, start with something bland and unchallenging to listen to. The room will most likely fall silent when you start playing, but you don't want it to stay that way for more than 10 or 15 seconds. After that, if nobody seems to notice you are even there, you are doing a good job.
At my wedding we hired a pianist to play for the entire dinner and reception. The problem was that while my wife and I had a few songs we wanted to hear, we had no where near a list to fill the 6 hour span.
The pianist was very nice, and explained that what he would do is work our music in, with some similar stuff, but that the bulk of it would come from songs that were/are popular with the average age of the audience.
He played our songs, and some wedding staples, but mostly played songs that the audience recognized, and enjoyed, by sticking to things popular with their age ranges.
All in all it was a great night, and everyone enjoyed his work, because everyone got to hear songs they liked, even if every song wasn't one they recognized.
That is my suggestion to you, play songs that are popular with the age ranges of your audience. Even if it's a wide range and you have to bounce around a bit, no one will dislike hearing their favorite song.
You should really ask the listeners. But ask with the piano.
As an example, you might start with the first few bars of Moonlight Sonata. If nobody reacts (looks at you with either approval or disappointment) then keep going. If you see any positive reactions, continue onto the second movement. Negative reactions, segue into something else.
And specifically for the Moonlight Sonata, treat the third movement as a separate piece!