Package it.hotel.model.structure

Examples of it.hotel.model.structure.Structure


   
    return c.size();
  }
 
  public Structure addStructure(){
    Structure structure1=new Structure();
    structure1.setAddress("via garibaldi");
    structure1.setBankaccount("76876587658687");
    structure1.setBriefdescription("breve descrizione");
    structure1.setCap("09800");
    structure1.setCity("Cagliari");
    structure1.setCodicefiscale("070429589304");
    structure1.setDescription("lunga descrizione");
    structure1.setFax("0898080");
    structure1.setName("setar");
    structure1.setCompanytaxnumber("62349562ncb982y5");
    structure1.setProvince("CA");
    structure1.setCompanytype("setar");
    structure1.setTelephone("070429589304");
    structure1.setLatitude(0.41241234);
    structure1.setLongitude(0.67576565);
    localizedHotelManager.add(structure1);
    return structure1;
  }
View Full Code Here


   
    assertEquals(className, "it.hotel.model.hotel.Hotel");
   
    assertEquals(stringNames[4], "Hotel" );
   
    Structure structure = new Structure();
   
    Class clazz1 = structure.getClass();
   
        String className1 = clazz1.getName();
   
    String[] stringNames1 = className1.split("\\.");
   
View Full Code Here

 
 
 
  @Test
  public void testFacility() throws Exception {
    Structure structure = (Structure) addStructure();
   
    Facility f = new Facility();
    f.setCode("SWIMMING");
    f.setDescription("Has a swimming pool");
    f.addStructure(structure);
    facilityRawManager.add(f);
    Facility fTest = (Facility) facilityRawManager.get(f.getId());
    Set<Structure> structures = (Set<Structure>) fTest.getStructures();
    assertEquals(1,structures.size());
    Structure sTest = structures.iterator().next();
    assertEquals(sTest.getName(),"setar");
  }
View Full Code Here

   * @return
   */
  public ModelAndView delete(HttpServletRequest req, HttpServletResponse resp){
    int id = Integer.parseInt(req.getParameter("id"));
    Room room = (Room) manager.get(id);
    Structure structure = room.getStructure();
    int structureId = structure.getId();
    manager.remove(id);
   
    return new ModelAndView("hotel.room.list", "rooms", manager.getRoomsFromStructure(structureId));
  }
View Full Code Here

    assertEquals(sTest.getName(),"setar");
  }
 
  @Test
  public void testUpdate() throws Exception {
    Structure structure = (Structure) addHotel();
    Facility f = new Facility();
    f.setCode("SWIMMING");
    f.setDescription("Has a swimming pool");
    structure.addFacility(f);
    Facility f2 = new Facility();
    f.setCode("FOOD");
    f.setDescription("blah blahblha");
    structure.addFacility(f2);
    localizedStructureManager.add(structure);
    Structure sTest = (Structure) localizedStructureManager.get(structure.getId());
    assertEquals(2,sTest.getFacilities().size());
    Set<Facility> facilities = new HashSet<Facility>();
    facilities.add(f);
    sTest.setFacilities(facilities);
    localizedStructureManager.add(sTest);
    Structure sTest2 = (Structure) localizedStructureManager.get(structure.getId());
    assertEquals(structure.getId(), sTest2.getId());
    assertEquals(1,sTest2.getFacilities().size());
   
  }
View Full Code Here

   * @return
   */
  public ModelAndView edit(HttpServletRequest req, HttpServletResponse resp){
    int id = Integer.parseInt(req.getParameter("id"));
    Room room = (Room) manager.get(id);
    Structure structure = room.getStructure();
    int hotel_id_for_room = structure.getId();
    req.setAttribute("typologies", typologyManager.getTypologiesFromStructure(hotel_id_for_room));
    req.setAttribute("hotel", structure);
    return new ModelAndView("hotel.room.new", "room", room);
  }
View Full Code Here

   */
  protected Map referenceData (HttpServletRequest req) throws Exception{
    Map map = new HashMap();
    User user = userContainer.getUser();
    int id = user.getStructureId();
    Structure hotel = (Structure) structureManager.get(id);
    ArrayList<Structure> hotels = new ArrayList<Structure>();
   
    hotels.add(hotel);
    map.put("hotels", hotels);
    return map;
View Full Code Here

   * @throws
   * @return
   */
  protected ModelAndView onSubmit(HttpServletRequest req, HttpServletResponse res, Object command, BindException errors) throws Exception{
    Customer customer = (Customer) command;
    Structure hotel = (Structure) structureManager.get(customer.getHotelId());
    customer.setStructure(hotel);
      customerManager.add(customer);
      if(req.getParameter("_target3") != null){
        return new ModelAndView("hotel.booking.customerNew", "customer", customer);
      }else{
View Full Code Here

    Map map = new HashMap();
    Typology typology = new Typology();
    String locale = localeContainer.getLocale();
    typology.setLocale(locale);
    ArrayList<Structure> hotels = new ArrayList<Structure> ();
    Structure hotel = (Structure) structureManager.get(userContainer.getUser().getStructureId());
    hotels.add(hotel);
    map.put("hotels", hotels);
    return map;
  }
View Full Code Here

  public ModelAndView handleRequest(HttpServletRequest req,
      HttpServletResponse resp) throws Exception {
    String idString = req.getParameter("id");
    
   
    Structure hotel=(Structure) structureManager.get(Integer.parseInt(idString));
    Collection<Photo> photos = (Collection<Photo>)hotel.getGallery().getPhotos();
   
    ModelAndView mv= new ModelAndView("photo","photos",photos) ;
   
      
       
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.