private void RemoveOccurrences(Appointment appointment)
        {
            var tempList = appointment.RecurrenceRule.Exceptions;

            foreach (ExceptionOccurrence item in tempList)
            {
                CalendarRepository.Context.DeleteObject(item);
            }
        }
        private void RemoveResources(Appointment appointment)
        {
            var tempAppList = CalendarRepository.Context.AppointmentResources.Where(i => i.Appointments_AppointmentID == appointment.AppointmentID);

            foreach (var item in tempAppList)
            {
                CalendarRepository.Context.DeleteObject(item);
            }
        }
 private void InitializeDate(Appointment newAppointment)
 {
     newAppointment.Start = newAppointment.End = DateTime.Now;
 }
 public RecurrenceRule(Appointment appointment)
     : this()
 {
     this.MasterAppointment = appointment;
 }
 public static void InsertAppointment(Appointment appointment)
 {
     Context.AddToAppointments(appointment);
     AppointmentsCache.Add(appointment);
 }
        private static bool IsContainedInResult(List<Appointment> appointments, Appointment appointment)
        {
            var result = !appointments.Contains(appointment);

            return result;
        }
        private static bool HasExceptionOccurenceWithinDateRange(Appointment appointment, DateTime start, DateTime end)
        {
            var result = appointment.ExceptionOccurrences.Any(e => e.ExceptionAppointment != null && e.ExceptionAppointment.Start >= start && e.ExceptionAppointment.End <= end);

            return result;
        }