/**
   * This is the action called from the Struts framework.
   *
   * @param mapping The ActionMapping used to select this instance.
   * @param form The optional ActionForm bean for this request.
   * @param request The HTTP Request we are processing.
   * @param response The HTTP Response we are processing.
   * @throws java.lang.Exception
   * @return
   */
  @Override
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    FloorForm inputForm = (FloorForm) form;
    RestaurantManager manager = new RestaurantManager();

    Place place = manager.findPlaceByName(inputForm.getFloorId());

    TicketInfo ticketInfo = manager.findTicket(place.id);

    if (ticketInfo.getUser() == null) {
      ticketInfo.setUser((UserInfo) request.getSession().getAttribute("user"));
    }
    TicketDAO tkdao = new TicketDAO();
    tkdao.updateTicket(place.id, ticketInfo);

    PrintPDA printer = new PrintPDA();
    printer.PrintPDATicket(place.getName(), ticketInfo, place.getName());

    // Obtenemos un Iterador y recorremos la lista.
    List<TicketLineInfo> lst = ticketInfo.getLines();
    ListIterator iter = lst.listIterator();
    int i = 0;
    while (iter.hasNext()) {
      ticketInfo.getLine(i).getProperties().setProperty("sendstatus", "Yes");
      i = i + 1;
      if (i >= lst.size()) break;
    }
    tkdao = new TicketDAO();
    tkdao.updateTicket(place.id, ticketInfo);

    return mapping.findForward(PRINTING);
  }