Not being able to exercise for two weeks WILL NOT make or break your healthy lifestyle. Injuries and recovering from them are something active people have to learn to live with. As long as you are mindful of what you eat, you will not gain weight. When it comes to weight loss or even weight gain, what matters most is what we eat. Good nutrition is what takes the weight off and keeps it off. Exercise is what keeps our bodies fit and healthy. In short, you can't outrun a bad diet with exercise.
As long as you eat right and watch your portions, you'll be fine these two weeks. Listen to your doctor. If they want you to lay off exercise, lay off exercise. it's only two weeks.