예제 #1
0
 private static bool ReplacementIsPossible(Time newBeginTime, Time newEndTime, Guid newTherapyplaceId,
                                           Guid originalAppointmentId,
                                           FixedAppointmentSet sourceAppointmentSet, FixedAppointmentSet destinationAppointmentSet)
 {
     return(DeletionPossible(originalAppointmentId, sourceAppointmentSet) &&
            AddingIsPossible(newTherapyplaceId, originalAppointmentId, newBeginTime, newEndTime, destinationAppointmentSet));
 }
예제 #2
0
 private static bool AddingIsPossible(Guid therapyPlaceId, Guid appointmentId,
                                      Time startTime, Time endTime,
                                      FixedAppointmentSet appointmentSet)
 {
     return(appointmentSet.Appointments
            .Where(appointment => appointment.TherapyPlace.Id == therapyPlaceId)
            .Where(appointment => appointment.Id != appointmentId)
            .All(appointment => (appointment.StartTime <= startTime || appointment.StartTime >= endTime) &&
                 (appointment.EndTime <= startTime || appointment.EndTime >= endTime)));
 }
예제 #3
0
 private static bool DeletionPossible(Guid appointmentId, FixedAppointmentSet appointmentSet)
 {
     return(appointmentSet.Appointments.Any(appointment => appointment.Id == appointmentId));
 }