I have a list of 7 employees. I repeat the cycle of dates of the current month and I want to appoint two employees for each date, but on weekends they should not repeat until all employees are appointed. For example: I have seven employees:
John
Sophia
Olivia
Davis
Clark
Paul
Thomas
Now my date loop:
for (int i = 0; i < dates.Length; i++)
{
DateTime newDate = new DateTime();
newDate = dates[i];
/*if(newdate == "Saturday")
var EmpName1 = emplist[i];
var EmpName2 = emplist[i];*/
}
In the above cycle, I want to appoint two employees each on Saturday and Sunday, until all the others have been appointed earlier. Something like that:
4th March: John and Sophia
5th March: Olivia and Davis
11th March: Clark and Paul
12th March: Thomas and John
etc. John will not be appointed until all of them are appointed. After that, the list will start again. Can someone help me with this?
source
share