If you looking to retrieve the day of week from date you can try the below approach
DateTime date = DateTime.Now;
Console.WriteLine(date.ToString("dddd"));
Refer
How to: Extract the Day of the Week from a Specific Date[
^]
[Update]
Create an enum called days
enum Days
{
sunday,
monday,
tuesday,
wednesday,
thrusday,
friday,
saturday,
};
You can then use this enum value as a input parameter and retrieve the date of week day using the below logic.
Days weekday = Days.sunday;
DateTime Today = DateTime.Today;
DateTime finalDate;
if ((int)Today.DayOfWeek < (int)weekday)
{
finalDate = Today.Date.AddDays((int)weekday - (int)Today.DayOfWeek);
}
else
{
finalDate = Today.Date.AddDays((int)weekday - (int)Today.DayOfWeek + 7);
}
[/Update]