Package no.ugland.utransprod.gui.model

Examples of no.ugland.utransprod.gui.model.AbstractOrderModel


    return returnValue;
  }

  @SuppressWarnings("unchecked")
  private AbstractOrderModel lazyLoadPackable() {
    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();
    OverviewManager overviewManager = (OverviewManager) ModelUtil
        .getBean(abstractOrderModel.getManagerName());

    overviewManager.refreshObject(abstractOrderModel.getObject());
    overviewManager.lazyLoad(abstractOrderModel.getObject(),
        new LazyLoadEnum[][] {
            { LazyLoadEnum.COLLIES, LazyLoadEnum.NONE },
            { LazyLoadEnum.ORDER_LINES, LazyLoadEnum.NONE },
            { LazyLoadEnum.ORDER_COMMENTS, LazyLoadEnum.NONE } });
    return abstractOrderModel;
View Full Code Here


   * @param combo
   */
  @SuppressWarnings("unchecked")
  void refreshTableOrder(OrderLine updatedOrderLine, boolean removeColli,
      WindowInterface window, boolean combo) {
    AbstractOrderModel abstractOrderModel=lazyLoadPackable();
    OverviewManager overviewManager = (OverviewManager) ModelUtil
    .getBean(abstractOrderModel.getManagerName());

    int rowCount = tableOrderLines.getRowCount();
    if (combo) {
      rowCount--;
    }

   

    boolean colliDone = true;
    if (removeColli) {
      List<OrderLine> orderLineList1 = (abstractOrderModel
          .getOrderLines());
      OrderLine orderLine = orderLineList1.get(orderLineList1
          .indexOf(updatedOrderLine));
      orderLine.setColli(null);
      if (rowCount == 0) {
        colliDone = false;
      }
    }

    tableOrders.revalidate();
    tablePostShipment.revalidate();

    abstractOrderModel.setStatus(null);
    if (abstractOrderModel.getPackageStarted() == null)
      abstractOrderModel.setPackageStarted(Calendar.getInstance()
          .getTime());

    if (rowCount == 0 && colliDone) {
      abstractOrderModel.setColliesDone(1);

    } else {
      abstractOrderModel.setColliesDone(0);

    }

    try {
      overviewManager.saveObject(abstractOrderModel.getObject());
    } catch (ProTransException e) {
      Util.showErrorDialog(window, "Feil",
          "Ordre er oppdatert av noen andre, oppdater f�r lagring");
      e.printStackTrace();
    } catch (HibernateOptimisticLockingFailureException e) {
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.Updateable#doNew(no.ugland.utransprod.gui.WindowInterface)
   */
  @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);
    abstractOrderModel.addColli(newColli);
    updatePanel();
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  void saveComment(WindowInterface window) {

    presentationModelPackable.triggerCommit();
    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();

    OverviewManager overviewManager = (OverviewManager) ModelUtil
        .getBean(abstractOrderModel.getManagerName());
    try {
      overviewManager.saveObject(abstractOrderModel.getObject());
    } catch (ProTransException e) {
      Util.showErrorDialog(window, "Feil", e.getMessage());
      e.printStackTrace();
    }
    if (orderSelectionList.hasSelection()) {
View Full Code Here

  @SuppressWarnings("unchecked")
  private void saveAndAddOrderComment(OrderComment orderComment,
      WindowInterface window) {

    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();

    initializeAndSaveOrderComment(abstractOrderModel.getOrder(),
        orderComment, abstractOrderModel.getDeviation(), window);

  }
View Full Code Here

     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    @SuppressWarnings("unchecked")
    public void actionPerformed(ActionEvent arg0) {

      AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
          .getBean();

      if (abstractOrderModel != null) {
        OverviewManager overviewManager = (OverviewManager) ModelUtil
            .getBean(abstractOrderModel.getManagerName());
        overviewManager.refreshObject(abstractOrderModel.getObject());

        OrderLine newOrderLine = addArticle(window, abstractOrderModel);
        if (newOrderLine != null) {
          abstractOrderModel.setColliesDone(0);
          newOrderLine.setAttributeInfo(newOrderLine
              .getAttributesAsString());
          try {
            managerRepository.getOrderLineManager().saveOrderLine(
                newOrderLine);
            overviewManager.saveObject(abstractOrderModel
                .getObject());
            abstractOrderModel.addOrderLine(newOrderLine);
            ownOrderLineList.add(newOrderLine);
          } catch (ProTransException e) {
            Util.showErrorDialog(window, "Feil", e.getMessage());
            e.printStackTrace();
          }
View Full Code Here

        OrderLine orderLine = (OrderLine) orderLineSelectionList
            .getElementAt(tableOrderLines
                .convertRowIndexToModel(orderLineSelectionList
                    .getSelectionIndex()));
        if (orderLine != null) {
          AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
              .getBean();
          OverviewManager overviewManager = (OverviewManager) ModelUtil
              .getBean(abstractOrderModel.getManagerName());
          ownOrderLineList.remove(orderLine);

          abstractOrderModel.removeOrderLine(orderLine);
          abstractOrderModel.viewToModel();
          try {
            overviewManager.saveObject(abstractOrderModel
                .getObject());
          } catch (ProTransException e) {
            Util.showErrorDialog(window, "Feil", e.getMessage());
            e.printStackTrace();
          }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.gui.model.AbstractOrderModel

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.