Package it.hotel.model.customer

Examples of it.hotel.model.customer.Customer


    if(page==2){
      ((BookingFrontendDTO)command).setRoomsToSelect(performPageTwo(command));
    }
    if(page==3){
      performPageThree(req, command);
      Customer customer = this.addAndGetCustomer(req, command);
      ((BookingFrontendDTO)command).setCustomer(customer);
      List<Room> roomsToBooking = ((BookingFrontendDTO)command).getRoomsToBooking();
      Long days = CalendarUtils.daysBetween(((Booking)command).getBeginDate(),((Booking)command).getFinishDate());
     
    }
View Full Code Here


    return null;
  }

  private Customer addAndGetCustomer(HttpServletRequest req, Object command) {
    BookingFrontendDTO prenotazione = (BookingFrontendDTO)command;
    Customer customer = new Customer();
    customer.setName(prenotazione.getName());
    customer.setSurname(prenotazione.getSurname());
    customer.setMail(prenotazione.getMail());
    customer.setStructure(prenotazione.getStructure());

    prenotazione.setCustomer(customer);

    return customer;
  }
View Full Code Here

   * @param resp
   * @return
   */
  public ModelAndView edit(HttpServletRequest req, HttpServletResponse resp) {
    String id = req.getParameter("id");
    Customer customer = (Customer) manager.get(Integer.parseInt(id));
    if(id != null){
      ArrayList<Structure> hotels = new ArrayList<Structure>();
      hotels.add(customer.getStructure());
      req.setAttribute("hotels", hotels);
          return new ModelAndView("hotel.customer.new", "customer", customer);     
    }
        return this.list(req, resp);
    }
View Full Code Here

   * @param req
   * @param resp
   * @return
   */
  public ModelAndView create(HttpServletRequest req, HttpServletResponse resp) {
        return new ModelAndView("hotel.customer.new", "customer", new Customer());
    }
View Full Code Here

     
  }


  private void setupExpectedCustomers() {
    Customer c1=new Customer();
    c1.setId(1);
    c1.setHotelId(1);
    Customer c2=new Customer();
    c2.setId(2);
    c2.setHotelId(1);
    expectedCustomers.add(c1);
    expectedCustomers.add(c2);
  }
View Full Code Here

  private void createModels() {
    hotel= new Hotel();
    typology=new Typology();
   
    customer=new Customer();
    room= new Room();
  }
View Full Code Here

       
  }
   
    public void setCustomer(){
     
    c= new Customer();
    c.setAddress("via del campo");
    c.setCap("0908");
    c.setCity("Cagliari");
    c.setCodicefiscale("123Stella");
    c.setGender("male");
    c.setStructure(hotel2);
    c.setHotelId(hotel2.getId());
    c.setName("Zorro");
    c.setNation("Messico");
    c.setSurname("Don DIego");
    c.setTelephone("000897");
    customerRawManager.add(c);
   
    c1= new Customer();
    c1.setAddress("vias del campo");
    c1.setCap("0908");
    c1.setCity("Cagliari");
    c1.setCodicefiscale("123Stella");
    c1.setGender("male");
    c1.setStructure(hotel2);
    c1.setHotelId(hotel2.getId());
    c1.setName("Zorros");
    c1.setNation("Messico");
    c1.setSurname("Don ego");
    c1.setTelephone("0300897");
    customerRawManager.add(c1);
   
    Customer c2= new Customer();
    c2.setAddress("vias del campo");
    c2.setCap("0908");
    c2.setCity("Cagliari");
    c2.setCodicefiscale("123Stella");
    c2.setGender("male");
    c2.setStructure(hotel1);
    c2.setHotelId(hotel2.getId());
    c2.setName("Zorros");
    c2.setNation("Messico");
    c2.setSurname("Don ego");
    c2.setTelephone("0300897");
    customerRawManager.add(c2);
 
    }
View Full Code Here

         
  }
 
  public void setCustomer() {
   
    customer = new Customer();
    customer.setAddress("via del campo");
    customer.setCap("0908");
    customer.setCity("Cagliari");
    customer.setCodicefiscale("123Stella");
    customer.setGender("male");
View Full Code Here

   * @return
   */
  @Override
  protected Object formBackingObject(HttpServletRequest request)
      throws Exception {
    Customer customer = (Customer) super.formBackingObject(request);;

    SystemUtils.print("customer", customer.getName());
   
    String name = request.getParameter("name");
    String surname = request.getParameter("surname");
   
    if(!"".equals(name)) customer.setName(name);   
    if(!"".equals(surname)) customer.setSurname(surname);
   
    return customer;
  }
View Full Code Here

   */
  @Override
  protected ModelAndView processFormSubmission(HttpServletRequest request,
      HttpServletResponse response, Object command, BindException errors)
      throws Exception {
    Customer customer = (Customer) formBackingObject(request);   
    request.setAttribute("elements", customerManager.searchCustomer(customer));   
    return super.processFormSubmission(request, response, command, errors);   
  }
View Full Code Here

TOP

Related Classes of it.hotel.model.customer.Customer

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.