How can I stay happy while I'm at work?

Fulfill your values. Identify what matters most to you in life and then bring those values into your work. In this way, you can fulfill what matters most to you.
Find Happiness. Be sure to work in something that is fulfilling to you to maintain happiness. If you are doing something you don't like or if you are subjected to excessive stress then this may not be possible where you are currently working. In this situation, start seeking a new job . Of course some happiness comes from having a job that pays so don't be too hasty in this economy to give up one before ready.