public static List <CustomAppointment> GetAppointments(List <CustomResource> resources) { List <CustomAppointment> appointments = new List <CustomAppointment>(); foreach (CustomResource item in resources) { string subjPrefix = item.Name + "'s "; appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "meeting", item.ResID, 2, 5, lastInsertedID++)); appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "travel", item.ResID, 3, 6, lastInsertedID++)); appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "phone call", item.ResID, 0, 10, lastInsertedID++)); } return(appointments); }
public static List <CustomAppointment> GetAppointments(List <CustomResource> resources) { //if (_appointments == null) { _appointments = new List <CustomAppointment>(); foreach (CustomResource item in resources) { for (int i = -30; i < 30; i++) { string subjPrefix = item.Name + "'s "; _appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "meeting", item.ResID, 2, 5, lastInsertedID++, DateTime.Now.AddDays(i), DateTime.Now.AddDays(i).AddHours(3))); _appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "travel", item.ResID, 3, 6, lastInsertedID++, DateTime.Now.AddDays(i), DateTime.Now.AddDays(i).AddHours(4))); _appointments.Add(CustomAppointment.CreateCustomAppointment(subjPrefix + "phone call", item.ResID, 0, 10, lastInsertedID++, DateTime.Now.AddDays(i), DateTime.Now.AddDays(i).AddHours(2))); } } //} return(_appointments); }