Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Colli


    if (transportlistable instanceof PostShipment) {
      postShipment.setPostShipmentRef((PostShipment) transportlistable);
    }

    postShipmentManager.savePostShipment(postShipment);
    Colli colli;
    Iterator<OrderLine> it = orderLines.iterator();
    while (it.hasNext()) {
      OrderLine orderLine = it.next();
      orderLine.setPostShipment(postShipment);
      colli = orderLine.getColli();
      if (colli != null) {
        ColliManager colliManager = (ColliManager) ModelUtil
            .getBean("colliManager");
        colli.setPostShipment(postShipment);
        colli.setOrder(null);
        colliManager.saveColli(colli);
      }
    }

    /*
 
View Full Code Here


    /**
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      Colli colli = (Colli) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return colli;
      case 1:
        return colli.getSentBool();

      default:
        throw new IllegalStateException("Unknown column");
      }
    }
View Full Code Here

     * @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object,
     *      int, int)
     */
    @Override
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
      Colli colli = (Colli) getRow(rowIndex);

      switch (columnIndex) {
      case 1:
        if ((Boolean) aValue) {
          colli.setSent(sentDate);
        } else {
          colli.setSent(null);
        }
        break;
      }
    }
View Full Code Here

    }

  }

  private Colli getColli(Applyable applyable, OrderLine orderLine) {
    Colli colli = colliMap.get(applyable.getArticleName()+applyable.getOrderNr());
    if (colli == null) {
      String colliName = Util.getColliName(applyable.getArticleName());
      colliName=colliName!=null?colliName:defaultColliName;
     
      if (applyable.isForPostShipment()) {
        colli = managerRepository.getColliManager()
            .findByNameAndPostShipment(colliName,
                orderLine.getPostShipment());
      } else {
        colli = managerRepository.getColliManager().findByNameAndOrder(
            colliName, orderLine.getOrder());
      }
      if (colli == null) {
        if (orderLine.getPostShipment() != null) {
          colli = new Colli(null, null, colliName, null, null, null,
              orderLine.getPostShipment(), null, Util
                  .getCurrentDate());
        } else {
          colli = new Colli(null, orderLine.getOrder(), colliName,
              null, null, null, null, null, Util.getCurrentDate());
        }
      } else {
        managerRepository.getColliManager().lazyLoad(
            colli,
View Full Code Here

  private List<Colli> getCollies() {
    Iterator<Applyable> it = articles.iterator();
    Set<Colli> collies = new HashSet<Colli>();
    while (it.hasNext()) {
      Colli colli =it.next().getColli();
      boolean added=colli!=null?collies.add(colli):false;
    }
    return new ArrayList<Colli>(collies);
  }
View Full Code Here

    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
      Applyable applyable = (Applyable) getRow(rowIndex);
      String columnName = getEnumColumnName(columnIndex);
      OrderLine orderLine = managerRepository.getOrderLineManager()
      .findByOrderLineId(applyable.getOrderLineId());
      Colli colli = getColli(applyable,orderLine);
      ArticleColumn.valueOf(columnName)
          .setValue(applyable, aValue, colli,orderLine);
      managerRepository.getOrderLineManager().saveOrderLine(orderLine);
      managerRepository.getColliManager().saveColli(colli);
      fireRefreshCollies();
View Full Code Here

   * @param index
   * @throws ProTransException
   */
  public void addOrderLine(OrderLine orderLine, int index)
      throws ProTransException {
    Colli currentColli = ((ColliModel) presentationModel.getBean())
        .getObject();

    Set<OrderLine> orderLines = currentColli.getOrderLines();
    if (orderLines == null) {
      orderLines = new HashSet<OrderLine>();
    }
    orderLine.setColli(currentColli);

    orderLines.add(orderLine);
    currentColli.setOrderLines(orderLines);

    currentColli.setPackageDate(Util.getCurrentDate());
    ((ColliManager) overviewManager).saveColli(currentColli);
    managerRepository.getOrderLineManager().saveOrderLine(orderLine);

    Order order = currentColli.getOrder();

    if (order != null) {

      managerRepository.getOrderLineManager().lazyLoadOrder(
          order,
          new LazyLoadOrderEnum[] { LazyLoadOrderEnum.ORDER_LINES,
              LazyLoadOrderEnum.ORDER_LINE_ORDER_LINES });
      if (order.isDonePackage()) {
        order.setOrderComplete(Util.getCurrentDate());
        managerRepository.getOrderLineManager().saveOrder(order);
      }
    } else {
      PostShipment postShipment = currentColli.getPostShipment();

      if (postShipment != null) {
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
            .getBean("postShipmentManager");
        postShipmentManager
View Full Code Here

          .getElementAt(index);

      if (ApplicationParamUtil.getNotPackageList().indexOf(
          orderLine.getArticleName()) < 0) {

        Colli currentColli = ((ColliModel) presentationModel.getBean())
            .getObject();
        ((ColliManager) overviewManager).lazyLoad(currentColli,
            new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_LINES,
                LazyLoadEnum.NONE } });
        Set<OrderLine> orderLines = currentColli.getOrderLines();
        if (orderLines == null) {
          orderLines = new HashSet<OrderLine>();
        }

        boolean success = orderLines.remove(orderLine);
        if (success) {
          orderLine.setColli(null);
          currentColli.setOrderLines(orderLines);

          if (orderLines.size() == 0) {
            currentColli.setPackageDate(null);
          }

          ((ColliManager) overviewManager).saveColli(currentColli);
          managerRepository.getOrderLineManager().saveOrderLine(
              orderLine);
          orderLineList.remove(orderLine);

          Order order = currentColli.getOrder();
          if (order != null) {
            managerRepository.getOrderLineManager().refreshOrder(
                order);
            order.setOrderComplete(null);
            try {

              managerRepository.getOrderLineManager().saveOrder(
                  order);
            } catch (ProTransException e) {
              Util
                  .showErrorDialog(window, "Feil", e
                      .getMessage());
              e.printStackTrace();
            }
          } else {
            PostShipment postShipment = currentColli
                .getPostShipment();
            if (postShipment != null) {
              PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
                  .getBean("postShipmentManager");
              postShipment.setPostShipmentComplete(null);
View Full Code Here

    refreshColli();

  }

  private void refreshColli() {
    Colli currentColli = ((ColliModel) presentationModel.getBean())
        .getObject();
    managerRepository.getColliManager().refreshObject(currentColli);
    managerRepository.getColliManager().lazyLoad(
        currentColli,
        new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_LINES,
View Full Code Here

  @SuppressWarnings("unchecked")
  public void doNew(WindowInterface window) {
    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();

    Colli newColli = new Colli(null, abstractOrderModel
        .getOrderModelOrder(), null, null, null, null,
        abstractOrderModel.getOrderModelPostShipment(), null, null);
    ColliViewHandler colliViewHandler = new ColliViewHandler("Kolli",
        newColli, abstractOrderModel, login, managerRepository, window);
    colliViewHandler.openEditView(null, false, window);
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.Colli

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.