private bool MapLocationOperationScheduleProperties(LocationOperationSchedule locationOperationSchedule, LocationOperationScheduleDto dto) { var result = true; result &= new PropertyMapper <LocationOperationSchedule> (locationOperationSchedule, dto).MapProperty(x => x.Name, dto.Name).Map(); result &= new AggregateNodeCollectionMapper <LocationWorkHourDto, LocationOperationSchedule, LocationWorkHour> ( dto.LocationWorkHours, locationOperationSchedule, locationOperationSchedule.LocationWorkHours).MapAddedItem( AddLocationWorkHour).MapChangedItem(ChangeLocationWorkHour).MapRemovedItem(RemoveLocationWorkHour).Map(); return(result); }
private void ChangeLocationOperationSchedule( LocationOperationScheduleDto dto, Location location, LocationOperationSchedule locationOperationSchedule) { _mappingResult &= MapLocationOperationScheduleProperties(locationOperationSchedule, dto); }
private static void RemoveLocationWorkHour(LocationWorkHourDto dto, LocationOperationSchedule operationSchedule, LocationWorkHour workHour) { operationSchedule.RemoveWorkHour(workHour); }
private static void ChangeLocationWorkHour(LocationWorkHourDto dto, LocationOperationSchedule operationSchedule, LocationWorkHour workHour) { RemoveLocationWorkHour(dto, operationSchedule, workHour); AddLocationWorkHour(dto, operationSchedule); }
private static void AddLocationWorkHour(LocationWorkHourDto dto, LocationOperationSchedule operationSchedule) { operationSchedule.AddWorkHour(new LocationWorkHour(dto.DayOfWeek, new TimeRange(dto.StartTime, dto.EndTime))); }
private void RemoveLocationOperationSchedule( LocationOperationScheduleDto dto, Location location, LocationOperationSchedule locationOperationSchedule) { location.RemoveOperationSchedule(locationOperationSchedule); }