Package it.hotel.model.booking

Examples of it.hotel.model.booking.UnconfirmedBooking


    String begindate = CalendarUtils.GetDateAsString(booking.getBeginDate());
    String finishdate = CalendarUtils.GetDateAsString(booking.getFinishDate());
    String code= booking.getStructure().getId() +booking.getName()+ booking.getSurname()+begindate+finishdate;
    customerManager.add(booking.getCustomer());
    for(Room room : booking.getRoomsToBooking()){
      Booking bookingSingleRoom = new UnconfirmedBooking();
      bookingSingleRoom.setAccomodation(booking.getAccomodation());
      bookingSingleRoom.setBeginDate(booking.getBeginDate());
      bookingSingleRoom.setCustomer(booking.getCustomer());
      bookingSingleRoom.setFinishDate(booking.getFinishDate());
      bookingSingleRoom.setStructure(booking.getStructure());
      bookingSingleRoom.setRoom(room);
      bookingSingleRoom.setCode(code);
      bookingManager.add(bookingSingleRoom);
      try {
        ArrayList<Booking> bookings = (ArrayList<Booking>)bookingManager.searchByExample(bookingSingleRoom);
        req.setAttribute("booking", bookings.get(0));
        mail.sendMailHotel(bookingSingleRoom);
        mail.sendMailCustomer(bookingSingleRoom);
      } catch (MailException e) {
        System.out.println(e.getMessage());
        bookingManager.remove(bookingSingleRoom.getId());
        throw e;
      }
   
     
    }
View Full Code Here


     local = StringUtils.parseLocaleString(localeContainer.getLocale());
    String header=messageSource.getMessage("mailIntestazione", null,local);
    ModelAndView mv= new ModelAndView("redirect:https://www.paypal.com/cgi-bin/webscr") ;
   
    int bookingId = Integer.parseInt(req.getParameter("booking"));
    UnconfirmedBooking bookingFrontendDTO = (UnconfirmedBooking)bookingManager.get(bookingId);
      
       mv.addObject("business", "tele.c@tiscali.it");
       mv.addObject("item_name", "Pernottamento al "+ bookingFrontendDTO.getStructure().getName());
       mv.addObject("cmd", "_xclick");
       mv.addObject("cancel_return","http://localhost:8080/hotel");
       mv.addObject("rm",2);
       mv.addObject("lc" ,localeContainer.getLocale());
       mv.addObject("business", bookingFrontendDTO.getStructure().getPaypalAccount());
       mv.addObject("custom","ig?hl=it");
       mv.addObject("return" ,"http://localhost:8080/hotel/paypal/hotel.htm?id="+bookingFrontendDTO.getCode());
       mv.addObject("currency_code" ,"EUR");   
       mv.addObject("state" ,"IT");
       return mv;
  }
View Full Code Here

     
      if(list.get(i).getType().compareTo("UNCONFIRMED")==0){
      if(list.get(i).getCode().compareTo(idString)==0)
      {
      id=list.get(i).getId();
      UnconfirmedBooking unconfirmed= (UnconfirmedBooking) bookingManager.get(id);
       booking= new Booking(unconfirmed);
      bookingManager.add(booking);
      bookingManager.remove(id);
   
      mail.sendMailPagamentoHotel(booking);
View Full Code Here

  

    public void testEnableBooking(){
     
     
      UnconfirmedBooking booking1 = new UnconfirmedBooking(b2);
     
      Booking booking2 = bookingRawManager.enableBooking(booking1);
     
      assertEquals(booking2.getType(), "BOOKING")
     
View Full Code Here

   */
  @SuppressWarnings("finally")
  public ModelAndView enableBooking(HttpServletRequest req, HttpServletResponse resp) throws Exception{
   
    int id = Integer.parseInt(req.getParameter("id"));
      UnconfirmedBooking unConfirmed= (UnconfirmedBooking) bookingManager.get(id);
    GregorianCalendar beginDate= unConfirmed.getBeginDate();
    GregorianCalendar finishDate=unConfirmed.getFinishDate();
    Room room=unConfirmed.getRoom();
         
            Booking booking=new Booking(unConfirmed);
            if(bookingManager.isRoomVacant(beginDate, finishDate, room)){
           
            bookingManager.add(booking);
           
            try {
              mail.sendMailEnable(booking);
        } catch (MailException e) {
          System.out.println(e.getMessage());
          bookingManager.remove(booking.getId());
          throw new Exception ();
        }
        bookingManager.remove(id);
       
            }
            else{
            
               id=unConfirmed.getId();
         
            try {
              mail.sendMailEnable(booking);
          } catch (MailException e) {
            System.out.println(e.getMessage());
            throw new Exception ();
          }
         
           
            return new ModelAndView("redirect:/Booking/edit.htm","id", unConfirmed.getId());
           
            }
     
    return this.listUnconfirmed(req, resp);

View Full Code Here

TOP

Related Classes of it.hotel.model.booking.UnconfirmedBooking

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.