$bookRegistry->setPage($_POST["pageBookRegistryB"]);
         $bookRegistry->setNumber($_POST["numBookRegistryB"]);
         BaptismManager::addBaptismRegistry($bookRegistry);
         $bookRegistry = BaptismManager::getSingleBaptismRegistry('book', $_POST["bookBookRegistryB"], 'page', $_POST["pageBookRegistryB"], 'number', $_POST["numBookRegistryB"]);
         $baptism = new Baptism('0', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL');
         $baptism->setIdCivilRegistry('1');
         $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]);
         $baptism->setCelebrationDate($celb);
         $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]);
         if ($church !== NULL) {
             $baptism->setIdChurch($church->getId());
             $baptism->setIdRector(RectorManager::getSingleRector('idActualChurch', $church->getId())->getId());
         }
         $baptism->setIdOwner($child->getId());
         $baptism->setIdBookRegistry($bookRegistry->getId());
         BaptismManager::addBaptism($baptism);
     }
 } else {
     $baptism = BaptismManager::getSingleBaptism('id', $_POST["baptismId"]);
     if ($baptism !== NULL) {
         $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]);
         $baptism->setCelebrationDate($celb);
         $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]);
         if ($church !== NULL) {
             $baptism->setIdChurch($church->getId());
         }
         BaptismManager::updateBaptism($baptism);
         $baptismReg = BaptismManager::getSingleBaptismRegistry('id', $baptism->getIdBookRegistry());
         $baptismReg->setBook($_POST["bookBookRegistryB"]);
         $baptismReg->setPage($_POST["pageBookRegistryB"]);
         $baptismReg->setNumber($_POST["numBookRegistryB"]);