protected override MealBooking DoPostPutDto(Client currentClient, MealBookingDTO dto, MealBooking entity, string path, object param) { if (entity == null) { entity = new MealBooking(); } else { if (dto.NumberOfPeople == null) { dto.NumberOfPeople = entity.NumberOfPeople; } } GetMapper.Map(dto, entity); if (dto.Meal != null) { entity.Meal = MealService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Meal, currentClient, path); } if (dto.PeopleCategory != null) { entity.PeopleCategory = PeopleCategoryService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.PeopleCategory, currentClient, path); } if (dto.DinnerBooking != null) { entity.DinnerBooking = DinnerBookingService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.DinnerBooking, currentClient, path); } return(entity); }
protected override PricePerPerson DoPostPutDto(Client currentClient, PricePerPersonDTO dto, PricePerPerson entity, string path, object param) { if (entity == null) { entity = new PricePerPerson(); } GetMapper.Map(dto, entity); if (dto.PeopleCategory != null) { entity.PeopleCategory = PeopleCategoryService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.PeopleCategory, currentClient, path); } if (dto.Period != null) { entity.Period = PeriodService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Period, currentClient, path); } if (dto.Room != null) { entity.Room = RoomService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Room, currentClient, path); } if (dto.Tax != null) { entity.Tax = TaxService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Tax, currentClient, path); } return(entity); }
protected override PeopleBooking DoPostPutDto(Client currentClient, PeopleBookingDTO dto, PeopleBooking entity, string path, object param) { if (entity == null) { entity = new PeopleBooking(); } GetMapper.Map(dto, entity); if (dto.PeopleCategory != null) { entity.PeopleCategory = PeopleCategoryService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.PeopleCategory, currentClient, path); } if (dto.RoomBooking != null) { entity.RoomBooking = RoomBookingService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.RoomBooking, currentClient, path); } return(entity); }
protected override MealPrice DoPostPutDto(Client currentClient, MealPriceDTO dto, MealPrice entity, string path, object param) { if (entity == null) { entity = new MealPrice(); } GetMapper.Map(dto, entity); if (dto.Meal != null) { entity.Meal = MealService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Meal, currentClient, path); } if (dto.PeopleCategory != null) { entity.PeopleCategory = PeopleCategoryService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.PeopleCategory, currentClient, path); } if (dto.Tax != null) { entity.Tax = TaxService.PreProcessDTOPostPut(validationDictionnary, dto.HomeId, dto.Tax, currentClient, path); } return(entity); }