Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
namespace TherapistSchedule
{
public class Schedule
{
public int ExpectedScheduleDateID { get; set; }
public DateTime ScheduleVisitDate { get; set; }
}

class Program
{
static void Main(string[] args)
{
List<schedule> listofScheduledDates = new List<schedule>();

//Week1
listofScheduledDates.Add(new Schedule(){ExpectedScheduleDateID=1,ScheduleVisitDate=new DateTime(2015,08,03)});
listofScheduledDates.Add(new Schedule(){ExpectedScheduleDateID=1,ScheduleVisitDate=new DateTime(2015,08,05)});
listofScheduledDates.Add(new Schedule() { ExpectedScheduleDateID = 1, ScheduleVisitDate = new DateTime(2015, 08, 07) });

//Week2
listofScheduledDates.Add(new Schedule() { ExpectedScheduleDateID = 1, ScheduleVisitDate = new DateTime(2015, 08, 10) });
listofScheduledDates.Add(new Schedule() { ExpectedScheduleDateID = 1, ScheduleVisitDate = new DateTime(2015, 08, 12) });
listofScheduledDates.Add(new Schedule() { ExpectedScheduleDateID = 1, ScheduleVisitDate = new DateTime(2015, 08, 14) });

Console.WriteLine("Please find the below Schedule");

foreach (var schedule in listofScheduledDates)
{
Console.WriteLine(schedule.ScheduleVisitDate.ToShortDateString());
}

//now if user wish to Change the Schedule,i.e if he edits the Date 2015,08,05 to 2015,08,06.then all future dates
//(only in that week should be changed by 1day)
//dates should have a difference of 1
//how to do it.
Console.ReadKey();
}
}
}
Posted
Comments
Kishor_Kadam 5-Aug-15 9:22am    
Business rules : no 2 dates should be consequtive.
If a user proposes a new date..all dates should be changed accordingly.i.e alternative dates should be visible..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900