Example #1
0
 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);
 }
Example #2
0
 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);
 }