This code is beyond repair, in my view, due to it is based on hard-coded data. This style is not supportable. Good code never contains long
switch
or
if
statements such things are data-driven.
You could make the set of months the enumeration type and iterate through it, create array of data indexed by enumeration. For comprehensive approaches in this direction, please see my article:
Enumeration Types do not Enumerate! Working around .NET and Language Limitations[
^].
There are different approaches, though.
—SA