Examples of ConstructionTypeArticle


Examples of no.ugland.utransprod.model.ConstructionTypeArticle

  public static Set<ConstructionTypeArticle> clonedConstructionTypeArticles(
      Set<ConstructionTypeArticle> articles) {
    HashSet<ConstructionTypeArticle> clonedSet = new HashSet<ConstructionTypeArticle>();
    if (articles != null) {
      for (ConstructionTypeArticle article : articles) {
        clonedSet.add(new ConstructionTypeArticle(article
            .getConstructionTypeArticleId(), article
            .getConstructionType(), article.getArticleType(),
            clonedAttributes(article.getAttributes()), article
                .getConstructionTypeArticleRef(),
            clonedConstructionTypeArticles(article
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

    HashSet<ConstructionTypeArticle> newArticles = null;

    if (orgArticles != null && orgArticles.size() != 0) {
      newArticles = new HashSet<ConstructionTypeArticle>();

      ConstructionTypeArticle newConstructionTypeArticle;
      for (ConstructionTypeArticle article : orgArticles) {
        newConstructionTypeArticle = new ConstructionTypeArticle(null,
            newConstructionType, article.getArticleType(), null,
            constructionTypeArticleRef, null, article
                .getNumberOfItems(), null, article
                .getDialogOrder());

        newConstructionTypeArticle
            .setConstructionTypeArticles(copyConstructionTypeArticles(
                null, article.getConstructionTypeArticles(),
                newConstructionTypeArticle));
        newConstructionTypeArticle
            .setAttributes(copyConstructionTypeArticleAttributes(
                newConstructionTypeArticle, article
                    .getAttributes()));

        newArticles.add(newConstructionTypeArticle);
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

    orderLine.setOrdNo(1);
    Ordln ordln = new Ordln();
    ordln.setOrdlnPK(new OrdlnPK(2, 1));
    orderLine.setOrdln(ordln);
    orderLine.setLnNo(2);
    ConstructionTypeArticle constructionTypeArticle = new ConstructionTypeArticle();
    ArticleType articleType = new ArticleType();
    articleType.setArticleTypeName("Port");
    constructionTypeArticle.setArticleType(articleType);
    orderLine.setConstructionTypeArticle(constructionTypeArticle);
    final Order order = new Order();
    order.setOrderNr("100");
    order.addOrderLine(orderLine);
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

    List<ConstructionType> garasjer = constructionTypeManager.findAllIncludeMaster();

    Set<ConstructionTypeArticle> artikler;

    ConstructionTypeArticle gavl = null;
    ConstructionTypeArticle kledning = null;

    for (ConstructionType garasje : garasjer) {
      constructionTypeManager
          .lazyLoad(
              garasje,
              new LazyLoadConstructionTypeEnum[] { LazyLoadConstructionTypeEnum.CONSTRUCTION_TYPE_ARTICLE });
      artikler = garasje.getConstructionTypeArticles();


      for (ConstructionTypeArticle artikkel : artikler) {
       
        if (artikkel.getArticleName().equalsIgnoreCase("Gavl")) {
          gavl = artikkel;
          break;

        }
      }
     
     

      ConstructionTypeArticle gavlkledning = null;

      for (ConstructionTypeArticle artikkel : artikler) {
        Set<ConstructionTypeArticle> gavlkledningArtikler;
        if (artikkel.getArticleName().equalsIgnoreCase("Gavlkledning")) {
          gavlkledning = artikkel;
          constructionTypeManager
              .lazyLoadArticle(
                  artikkel,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.CONSTRUCTION_TYPE_ARTICLES });
          gavlkledningArtikler = artikkel
              .getConstructionTypeArticles();

          for (ConstructionTypeArticle gavlkledningArtikkel : gavlkledningArtikler) {
            if (gavlkledningArtikkel.getArticleName()
                .equalsIgnoreCase("Kledning")) {
              gavlkledningArtikkel
                  .setConstructionTypeArticleRef(gavl);
              kledning=gavlkledningArtikkel;
            }

          }
         
          if(kledning!=null){
          constructionTypeArticleManager.saveConstructionTypeArticle(kledning);
          }

          constructionTypeManager
              .lazyLoadArticle(
                  gavlkledning,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ORDER_LINE });
          Set<OrderLine> orderLines = gavlkledning.getOrderLines();
          Order order = null;
          Set<OrderLine> orderOrderLines;
          OrderLine gavlOrderLine = null;

          for (OrderLine orderLine : orderLines) {
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

   *
   * @param type
   */
  private void addAttributes(ConstructionType type) {
    List<ConstructionTypeArticle> articles;
    ConstructionTypeArticle orgArticle;
    Set<ConstructionTypeArticleAttribute> articleAttributes;
    Set<ConstructionTypeArticleAttribute> orgArticleAttributes;
    for (ConstructionTypeArticle article : universalArticles) {
      article.setConstructionType(type);
      if (type.getConstructionTypeArticles().contains(article)) {
        articles = new ArrayList<ConstructionTypeArticle>(type
            .getConstructionTypeArticles());
        orgArticle = articles.get(articles.indexOf(article));

        articleAttributes = article.getAttributes();
        orgArticleAttributes = orgArticle.getAttributes();
        for (ConstructionTypeArticleAttribute attribute : articleAttributes) {
          if (!orgArticleAttributes.contains(attribute)) {
            attribute.setConstructionTypeArticleAttributeId(null);
            orgArticle.addAttribute(attribute);
          }
        }
      }
    }
  }
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

              new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ATTRIBUTE });

      Set<ArticleTypeAttribute> attributes = newArticleType
          .getArticleTypeAttributes();

      ConstructionTypeArticle constructionTypeArticleMain = new ConstructionTypeArticle(
          null, currentConstructionType, newArticleType, null, null,
          null, null, null, null);

      Set<ConstructionTypeArticleAttribute> constructionTypeArticleAttributes = new HashSet<ConstructionTypeArticleAttribute>();

      for (ArticleTypeAttribute articleTypeAttribute : attributes) {
        constructionTypeArticleAttributes
            .add(new ConstructionTypeArticleAttribute(null,
                constructionTypeArticleMain,
                articleTypeAttribute, null, null));
      }

      if (constructionTypeArticleAttributes.size() != 0) {
        openAttributeView(constructionTypeArticleMain,
            constructionTypeArticleAttributes);

        constructionTypeArticleMain
            .setAttributes(constructionTypeArticleAttributes);
      }

      setArticleRefs(newArticleType, constructionTypeArticleMain);
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

        new LazyLoadArticleTypeEnum[] {
            LazyLoadArticleTypeEnum.ATTRIBUTE,
            LazyLoadArticleTypeEnum.ARTICLE_TYPE_ARTICLE_TYPE });
    Set<ArticleTypeArticleType> articleRefs = articleType
        .getArticleTypeArticleTypes();
    ConstructionTypeArticle constructionTypeArticle;
    Set<ConstructionTypeArticleAttribute> constructionTypeArticleAttributes;
    Set<ConstructionTypeArticle> constructionTypeRefs = new HashSet<ConstructionTypeArticle>();
    if (articleRefs != null && articleRefs.size() != 0) {
      for (ArticleTypeArticleType articleRef : articleRefs) {
        constructionTypeArticle = new ConstructionTypeArticle(null,
            null, articleRef.getArticleTypeRef(), null,
            constructionTypeArticleMain, null, null, null, null);

        ArticleType articleTypeRef = articleRef.getArticleTypeRef();
        managerRepository
            .getArticleTypeManager()
            .lazyLoad(
                articleTypeRef,
                new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ATTRIBUTE });
        Set<ArticleTypeAttribute> attributes = articleTypeRef
            .getArticleTypeAttributes();

        if (attributes != null) {
          constructionTypeArticleAttributes = new HashSet<ConstructionTypeArticleAttribute>();

          for (ArticleTypeAttribute attribute : attributes) {
            constructionTypeArticleAttributes
                .add(new ConstructionTypeArticleAttribute(null,
                    constructionTypeArticle, attribute,
                    null, null));
          }

          openAttributeView(constructionTypeArticle,
              constructionTypeArticleAttributes);

          constructionTypeArticle
              .setAttributes(constructionTypeArticleAttributes);

          setArticleRefs(articleRef.getArticleTypeRef(),
              constructionTypeArticle);
        }
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

      decimalFormat.setDecimalSeparatorAlwaysShown(false);
      decimalFormat.setParseIntegerOnly(true);
      BufferedValueModel bufferedArticles = presentationModel
          .getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);

      ConstructionTypeArticle article = (ConstructionTypeArticle) selectedNode
          .getObject();

      String numberOfValue = null;

      if (article.getNumberOfItems() != null) {
        numberOfValue = decimalFormat
            .format(article.getNumberOfItems());
      }

      numberOfValue = JOptionPane.showInputDialog(window.getComponent(),
          "Gi antall", numberOfValue);

      String orderValue = JOptionPane.showInputDialog(window
          .getComponent(), "Rekkef�lge", article.getDialogOrder());

      if (numberOfValue != null && numberOfValue.length() != 0) {
        article.setNumberOfItems(Integer.valueOf(numberOfValue.replace(
            ',', '.')));

      }
      if (orderValue != null) {
        if (orderValue.length() != 0) {
          article.setDialogOrder(Integer.valueOf(orderValue));
        } else {
          article.setDialogOrder(null);
        }
      }
      if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
        universalChangedArticles.add(article);
      }
View Full Code Here

Examples of no.ugland.utransprod.model.ConstructionTypeArticle

     * @see no.ugland.utransprod.gui.Updateable#doDelete(no.ugland.utransprod.gui.WindowInterface)
     */
    public boolean doDelete(WindowInterface window) {
      boolean deleted = true;
      if (selectedNode != null && !selectedNode.isLeaf()) {
        ConstructionTypeArticle article = (ConstructionTypeArticle) selectedNode
            .getObject();
        ((ConstructionTypeManager) overviewManager)
            .lazyLoadArticle(
                article,
                new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ORDER_LINE });
        if (article.getOrderLines() != null
            && article.getOrderLines().size() != 0) {
          deleted = false;
          Util
              .showErrorDialog(window, "Feil",
                  "Kan ikke slette artikkel som er referert til av en ordre");
        } else {

          ConstructionType constructionType = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
              .getRoot()).getObject();
          constructionType.getConstructionTypeArticles().remove(
              article);
          article.setConstructionType(null);

          presentationModel
              .setBufferedValue(
                  ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES,
                  new ArrayListModel(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.