Ejemplo n.º 1
0
 public SalesPoint toEntity(SalesPointVO vo) {
   if (vo == null) {
     return null;
   }
   SalesPoint rv = new SalesPoint();
   if (vo.getAddress() != null) {
     rv.setAdressId(vo.getAddress().getAddressId());
   }
   rv.setName(vo.getName());
   rv.setSalePointId(vo.getSalePointId());
   rv.setSalePointPhoneNumber(vo.getSalePointPhoneNumber());
   if (vo.getWarehouse() != null) {
     rv.setWareHouseId(vo.getWarehouse().getWarehouseId());
   }
   rv.setId(vo.getId());
   return rv;
 }
Ejemplo n.º 2
0
 public SalesPointVO toVO(SalesPoint entity) {
   if (entity == null) {
     return null;
   }
   SalesPointVO rv = new SalesPointVO();
   try {
     rv.setAddress(adConverter.toVO(addressDao.findAddressByAddressId(entity.getAdressId())));
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   rv.setSalePointPhoneNumber(entity.getSalePointPhoneNumber());
   rv.setId(entity.getId());
   rv.setSalePointId(entity.getSalePointId());
   rv.setName(entity.getName());
   try {
     rv.setWarehouse(
         whConverter.toVO(warehouseDao.findWarehouseByWarehouseId(entity.getWarehouseId())));
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   return rv;
 }