Package it.hotel.model.structure

Examples of it.hotel.model.structure.Structure


    boolean response1 = false;
    boolean response2 = false;
   
   
   
    Structure structure = (Structure) super.get(id);
   
    String tomcatPath = System.getProperty("catalina.home");
   
    String galleryDir = tomcatPath + File.separator + "webapps" +
                        File.separator + "hotel" + File.separator +
                        "resources" + File.separator + "images" +
                        File.separator + "imagesStruct" + structure.getId() +
                        File.separator + "gallery" + structure.getGallery().getId();
   
    String structureDir = tomcatPath + File.separator + "webapps" +
                              File.separator + "hotel" + File.separator +
                              "resources" + File.separator + "images" +
                              File.separator + "imagesStruct" + structure.getId();
   
    File galleryDirectory = new File(galleryDir);
   
    File structureDirectory = new File(structureDir);
     
    Set<Photo> photos = structure.getGallery().getPhotos();
   
    if(photos.isEmpty()) {
 
      if(galleryDirectory.isDirectory()) { DirectoryUtils.deleteDirectory(galleryDir); }
      if(structureDirectory.isDirectory()) { DirectoryUtils.deleteDirectory(structureDir); }
      galleryManager.remove(structure.getGallery());
      super.remove(structure);
       
    }
   
    else {
     
    Photo photo = photos.iterator().next();
   
    String galleryDir2 = photo.getUrl();
   
    String dirSmallPhoto = galleryDir + File.separator + "small";
    String dirBigPhoto   = galleryDir + File.separator + "big";
   
    response1 = DirectoryUtils.deleteDirectory(dirSmallPhoto);
    response2 = DirectoryUtils.deleteDirectory(dirBigPhoto);
                DirectoryUtils.deleteDirectory(galleryDir);
                DirectoryUtils.deleteDirectory(structureDir);
               
    this.deletePhotos(structure.getGallery());
    galleryManager.remove(structure.getGallery());
    super.remove(structure);
       
    }
   
  }
View Full Code Here


    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
  @Override
  public boolean add(Object object) {
   
   
    Structure structure = (Structure) object;
   
    if(structure.getId()==0) {
     
       boolean response;
     
       structure.getGallery().setStructure(structure);
   
           boolean answer1 = galleryManager.add(structure.getGallery());
          
           boolean answer2 = super.add(structure);
          
           if(answer1 && answer2) { return response = true; }
     
View Full Code Here

   *
   */
  @Transactional(readOnly = true, propagation = Propagation.REQUIRED)
 
  public List<Typology> getTypologiesFromStructure (int idHotel){
    Structure structure = (Structure) this.structureManager.get(idHotel);
    List<Typology> typologies = (List<Typology>) super.searchAll("structure", structure);
    return typologies;
  }
View Full Code Here

    try {
      user = userManager.getUser(username, password);
      Booking booking = new Booking();
      booking.setBeginDate(startdate);
      booking.setFinishDate(finishdate);
      Structure structure = (Structure) structureManager.get(user.getStructureId());
      booking.setStructure(structure);
      Room roomToBook = roomManager.getRoomFromRoomNumber(user.getStructureId(), room);
      booking.setRoom(roomToBook);
      Customer customer = new Customer();
      customer.setName(customername);
View Full Code Here

TOP

Related Classes of it.hotel.model.structure.Structure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.