The girl with whom I had an affair with is getting married with my full consent, but I couldn't get her out of my mind. I'm depressed and we both work together. Will I be able to come out of this depression? I'm suffering for the past one month with mostly crying.
In all likelihood, you are suffering from what is called an "adjustment disorder" - feelings of depression with tearfulness in response to losing the girl with whom you had an affair.
Even if she is marrying with your full consent and blessing, it is still a painful loss for you. The duration of an adjustment disorder is generally relatively brief (no more than a few months).
You might benefit from counseling to help you through this difficult time, and might specifically consider several forms of psychotherapy that have proven efficacy for this type of depression, namely interpersonal therapy (ITP) and cognitive-behavioral therapy (CBT).
However, if in addition to feeling depressed and tearful, you are currently experiencing disturbances in sleep or appetite, weight change, low energy, difficulty concentrating, feelings of hopelessness, or suicidal thoughts, you may have what is referred to as "Major Depression" (or clinical depression) and should certainly consult a psychiatrist to determine if antidepressant medication might be indicated in your case.
Of course, the fact that the woman you mention is also a co-worker will make the healing process more difficult -- especially if your affair occurred during the period of her engagement (perhaps leaving you with the hope that she might be willing to resume the affair).
Again, psychotherapy might be helpful to you in sorting out how best to cope with this dilemma. Almost all pain heals with time, often without the need for counseling or psychiatric help of any kind, so you have every reason to be hopeful that this too will pass. I certainly hope so.