public static CSYearSchedule QuickSchedule(string Name, double[] dayArray, double[] weArray, ScheduleType type, string category, string dataSource, ref CSLibrary Library) { //int[] MonthFrom = { 1 }; //int[] DayFrom = { 1 }; //int[] MonthTo = { 12 }; //int[] DayTo = { 31 }; CSDaySchedule someDaySchedule = new CSDaySchedule(Name, type, dayArray.ToList()); someDaySchedule.DataSource = dataSource; someDaySchedule.Category = category; someDaySchedule = Library.Add(someDaySchedule); CSDaySchedule weSchedule = new CSDaySchedule(Name + "WeekEnd", type, weArray.ToList()); weSchedule.DataSource = dataSource; weSchedule.Category = category; weSchedule = Library.Add(weSchedule); CSDaySchedule[] daySchedulesArray = { someDaySchedule, someDaySchedule, someDaySchedule, someDaySchedule, someDaySchedule, weSchedule, weSchedule }; WeekSchedule someWeekSchedule = new WeekSchedule(daySchedulesArray, new DateTime(2006, 1, 1), new DateTime(2006, 12, 31)); //someWeekSchedule.DataSource = dataSource; //someWeekSchedule.Category = category; //someWeekSchedule = Library.Add(someWeekSchedule); WeekSchedule[] weekSchedulesArray = { someWeekSchedule }; CSYearSchedule someYearSchedule = new CSYearSchedule(Name, type, weekSchedulesArray.ToList()); //, MonthFrom.ToList(), DayFrom.ToList(), MonthTo.ToList(), DayTo.ToList() someYearSchedule.DataSource = dataSource; someYearSchedule.Category = category; Library.Add(someYearSchedule); return(someYearSchedule); }
public WeekSchedule() { Days = new CSDaySchedule[7]; }