private static CallingDates GetCallingDates() { CallingDates callingDates = new CallingDates(); DateTime dateToCall = DateTime.Now; if (DateTime.Now.DayOfWeek == DayOfWeek.Monday) { callingDates.BeginCallingDate = dateToCall.AddDays(2).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(3).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday) { callingDates.BeginCallingDate = dateToCall.AddDays(2).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(3).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday) { callingDates.BeginCallingDate = dateToCall.AddDays(2).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(3).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday) { callingDates.BeginCallingDate = dateToCall.AddDays(4).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(5).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Friday) { callingDates.BeginCallingDate = dateToCall.AddDays(4).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(5).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday) { callingDates.BeginCallingDate = dateToCall.AddDays(3).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(4).ToShortDateString(); return callingDates; } else if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday) { callingDates.BeginCallingDate = dateToCall.AddDays(2).ToShortDateString(); callingDates.EndCallingDate = dateToCall.AddDays(3).ToShortDateString(); return callingDates; } return callingDates; }
private static void CheckForNewAppointmentsToCall() { CreateReminderRecordsSRS createReminderRecordsSRS = new CreateReminderRecordsSRS(); CallingDates callingDates = new CallingDates(); callingDates = GetCallingDates(); createReminderRecordsSRS.CreateReminderRecords(callingDates.BeginCallingDate, callingDates.EndCallingDate); CheckTelephoneNumbers(); CreateVoiceFiles(); CreateXMLFiles(); }