Package it.hotel.model.structure

Examples of it.hotel.model.structure.Structure


  @Override
  protected ModelAndView onSubmit(HttpServletRequest request,
      HttpServletResponse response, Object command, BindException errors)
  throws Exception {
   
    Structure structure = (Structure) command;
   
    String clazz = structure.getType();
   
    String locale = localeContainer.getLocale();
    String structureLocale = (String) request.getParameter("locale");
   
    if (!structureLocale.isEmpty())
    {
      structure.setLocale(structureLocale);
    }
    else
    {
      structure.setLocale(locale);
    }
   
    boolean newhotel = (structure.getId() == 0);
    this.replaceImageIfNotPresent(structure);
   
    localeContainer.setLocale(structure.getLocale());
    this.addStructure((Structure) structure);
    localeContainer.setLocale(locale);
    request.setAttribute("structure", structure);
    if(newhotel){
      return super.onSubmit(request, response, command, errors);
View Full Code Here


    UserContainer container = (UserContainer) context.getBean("userContainer");
    IStructureManager structureManager = (IStructureManager) context.getBean("structureRawManager");
    IBookingManager bookingManager = (IBookingManager) context.getBean("bookingRawManager");
      try {
        IUser user = container.getUser();
        Structure structure = (Structure) structureManager.get(user.getStructureId());
        if (structure != null){         
          Collection<Room> rooms = bookingManager.getVacantRoomsForStructure(structure, CalendarUtils.GetToday(), CalendarUtils.GetToday());
          pageContext.getOut().print(rooms.size());
        }
       
View Full Code Here

    }
  }
 
  private void replaceImageIfNotPresent(Structure structure){
    if(structure.getImage() != null && structure.getImage().length == 0){
      Structure structureOLD = (Structure) structureManager.get(structure.getId());
      if(structureOLD != null){
        structure.setImage(structureOLD.getImage());
      }
    }
  }
View Full Code Here

//  protected IStructureManager localizedStructureManager;
 
 
  private Structure setStructure() {
   
    Structure structure = new Structure();
   
    structure.setAddress("address");
    structure.setBankaccount("1234567890");
    structure.setBriefdescription("briefDescription");
    structure.setDescription("description");
    structure.setCity("Cagliari");
   
    return structure;
   
  }
View Full Code Here

   
  }
   
  public void testAddStructure() {
   
    Structure structure = setStructure();
   
    boolean response = localizedStructureManager.add(structure);
   
    assertTrue(response);
   
    Structure structure2 = (Structure) localizedStructureManager.get(structure.getId());
   
    assertEquals(structure, structure2);
       
  }
View Full Code Here

  }
 
  public void testRemoveStructureByObject() {
   
   
        Structure structure = setStructure();
   
    boolean response = localizedStructureManager.add(structure);
   
    assertTrue(response);
   
    int id = structure.getId();
   
    Structure structure2 = (Structure) localizedStructureManager.get(id);
   
    assertEquals(structure, structure2);
   
   
    localizedStructureManager.remove(structure);
   
    Structure structure3 = (Structure) localizedStructureManager.get(id);
   
    assertNull(structure3);
       
  }
View Full Code Here

  }
 
  public void testRemoveStructureById() {
   
   
        Structure structure = setStructure();
   
    boolean response = localizedStructureManager.add(structure);
   
    assertTrue(response);
   
    int id = structure.getId();
   
    Object structure2 =  localizedStructureManager.get(id);
   
    assertEquals(structure, structure2);
   
   
    localizedStructureManager.remove(id);
   
    Structure structure3 = (Structure) localizedStructureManager.get(id);
   
    assertNull(structure3);
   
  }
View Full Code Here

   
  }
 
  public void testSearchForAvailableRooms() throws Exception {
   
    Structure structure = setStructure();
   
    Collection<Structure> list = localizedStructureManager.searchForAvailableRoomsForCity(CalendarUtils.GetToday(), CalendarUtils.GetTomorrow(), "Cagliari");
   
   
     
View Full Code Here

   
    Hotel hotel = addHotel();
   
    int id = hotel.getId();
   
    Structure structure = (Structure) localizedStructureManager.get(id);
   
    assertEquals(hotel, structure);
   
    assertEquals("Hotel", structure.getType());
       
  }
View Full Code Here

  public ModelAndView handleRequest(HttpServletRequest req,
      HttpServletResponse resp) throws Exception {
    String idString = req.getParameter("id");
    
    String address= null;
    Structure hotel = (Structure) structureManager.get(Integer.parseInt(idString));
    address= hotel.getAddress()+","+hotel.getCity()+" "+"italia";
   
    ModelAndView mv= new ModelAndView("map","hotel",hotel) ;
   
      
       
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.