Package com.alexnevsky.hotel.model

Examples of com.alexnevsky.hotel.model.Order


    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
          + "'. Change order status to '" + OrderStatusEnum.CANCELLED.toString() + "' for '" + order + "'"
          + ". RemoteAddr: " + request.getRemoteAddr());
View Full Code Here


      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = null;
      order = orderDAO.find(orderId);

      if (customer.getId().compareTo(order.getCustomerId()) == 0
          && OrderStatusEnum.UNCHECKED.equals(order.getOrderStatus())) {
        orderDAO.update(OrderStatusEnum.CANCELLED, orderId);

        logger.info("Customer '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
            + "'. Change order status to '" + OrderStatusEnum.CANCELLED + "' for '" + order + "'"
            + ". RemoteAddr: " + request.getRemoteAddr());
View Full Code Here

      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
      form = formDAO.find(order.getFormId());

      logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
          + "'. Delete '" + order + "'" + " and '" + form + "'" + ". RemoteAddr: " + request.getRemoteAddr());

      orderDAO.delete(order);
View Full Code Here

      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = null;
      order = orderDAO.find(orderId);

      if (customer.getId().compareTo(order.getCustomerId()) == 0) {
        Boolean viewBillsList = true;
        request.setAttribute(AttributesManager.ATTRIBUTE_VIEW_BILLS_LIST, viewBillsList);
        request.setAttribute(AttributesManager.PARAM_NAME_ORDER_ID, orderId);
      } else {
        logger.warn("Customer '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
View Full Code Here

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      RoomDAO roomDAO = daoFactory.getRoomDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
      form = formDAO.find(formId);

      Room room = null;
      room = roomDAO.find(roomId);

      Double amount = null;
      if (form != null && room != null) {
        amount = room.getNightPrice() * form.getNights();
        orderDAO.update(roomId, amount, order.getId());
        orderDAO.update(OrderStatusEnum.CHECKED, order.getId());
      }

      request.setAttribute(AttributesManager.ATTRIBUTE_RESULT, MessageManager.RESULT_SELECT_ROOM_MESSAGE);

    } catch (DAOException ex) {
View Full Code Here

        logger.error(ex, ex);
      }

      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = new Order();
      order.setCustomerId(customer.getId());
      order.setFormId(form.getId());

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      try {
        orderDAO.create(order);
      } catch (IllegalArgumentException ex) {
View Full Code Here

      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
      form = formDAO.find(order.getFormId());

      request.getSession().setAttribute(AttributesManager.PARAM_NAME_ORDER_ID, order.getId());
      request.getSession().setAttribute(AttributesManager.PARAM_NAME_FORM_ID, form.getId());

    } catch (DAOException ex) {
      logger.error(ex, ex);
      request.setAttribute(AttributesManager.ATTRIBUTE_ERROR_MESSAGE, MessageManager.DAO_EXCEPTION_ERROR_MESSAGE);
View Full Code Here

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
      form = formDAO.find(order.getFormId());

      if (customer.getId().compareTo(order.getCustomerId()) == 0
          && OrderStatusEnum.CANCELLED.equals(order.getOrderStatus())) {
        logger.info("Customer '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
            + "'. Delete '" + order + "'" + " and '" + form + "'" + ". RemoteAddr: "
            + request.getRemoteAddr());
        orderDAO.delete(order);
        formDAO.delete(form);
View Full Code Here

  private String getData() {
    String dataToView = null;

    Customer customer = null;
    CreditCard creditCard = null;
    Order order = null;
    Form form = null;
    Room orderRoom = null;
    List<Room> freeRoomList = null;

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      CustomerDAO customerDAO = daoFactory.getCustomerDAO();
      RoomDAO roomDAO = daoFactory.getRoomDAO();
      CreditCardDAO creditCardDAO = daoFactory.getCreditCardDAO();

      order = orderDAO.find(this.orderId);
      form = formDAO.find(order.getFormId());

      freeRoomList = this.getFreeRooms(form);

      customer = customerDAO.find(order.getCustomerId());
      creditCard = creditCardDAO.find(customer.getCreditCardNumber());

      Long orderRoomId = order.getRoomId();

      Long formId = order.getFormId();
      form = formDAO.find(formId);

      orderRoom = roomDAO.find(orderRoomId);
    } catch (DAOException ex) {
      logger.error(ex, ex);
View Full Code Here

  }

  private String getData() {
    String dataToView = null;

    Order order = null;
    Form form = null;
    Customer customer = null;

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      CustomerDAO customerDAO = daoFactory.getCustomerDAO();

      order = orderDAO.find(this.orderId);
      form = formDAO.find(order.getFormId());
      customer = customerDAO.find(order.getCustomerId());
    } catch (DAOException ex) {
      logger.error(ex, ex);
      return MessageManager.DAO_EXCEPTION_ERROR_MESSAGE;
    }
View Full Code Here

TOP

Related Classes of com.alexnevsky.hotel.model.Order

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.