It is unclear what you want.
But if I guess correctly, you want to calculate weekdays (workdays) in a month. You can use
System.DateTime.DayOfWeek[
^] property to see what day of week is a specific date.
Here you have some methods:
http://stackoverflow.com/questions/1820173/calculate-the-number-of-weekdays-between-two-dates-in-c-sharp[
^], you just have to change them to take only Sunday as weekend, and Saturday as weekday/workday.
Update: here i found the most elegant one:
http://stackoverflow.com/questions/4022993/how-to-get-a-list-of-week-days-in-a-month[
^]. With a little adaptation:
public static int GetWorkdays(int year, int month)
{
return Enumerable.Range(1, DateTime.DaysInMonth(year, month))
.Select(day => new DateTime(year, month, day))
.Where(dt => dt.DayOfWeek != DayOfWeek.Sunday)
.Count();
}
}