Anytime you suffer a loss, there is a grief process. You will probably go through an abundance of emotions in these stages: denial, bargaining, depression, anger, acceptance. Sometimes you have all these in a short period of time or settle into one feeling for awhile. It sounds as if you are in the depression and anger stages right now. This does not mean you are having a nervous breakdown. And some of these symptoms can last for a while, even two years. But some of the symptoms you describe related to lack of motivation, negative attitude, no self confidence can be related to depression.
It may be a good time to re evaluate what you want out of life for yourself. Regardless of whether you have a partner or not. Make some goals for yourself for one year and five years and work toward those.
Although I would say "yes" changing your thoughts from negative to positive will help, you may find this difficult if you are having depressive symptoms. After two years, a mood improvement is in order. I would ask you to see your general practitioner for an antidepressant. Sometimes this helps get you motivated to do other things. The workplace also helps you feel good about yourself, and gain a sense of accomplishment. It will also put you back in a social network with coworkers, and this will help you feel more rational and normal again.
If you take action in a positive way, it will help you feel better, rather than waiting to feel better to take action. The more things you can do to take care of yourself in a positive way, the better you will feel about yourself, and the less you will think about your ex girlfriend.
Please let me know if you have further questions.