示例#1
0
        private Article GetParent(Article article)
        {
            OrderInformations articleInformations = new OrderInformations(article);

            int itemParentLevel = articleInformations.GetComponentLevel();// article);

            if (_orderInformationsFromArticles.IsParent(itemParentLevel))
            {
                itemParentLevel = articleInformations.GetComponentLevel();// article);
                return(article);
            }

            Article parent = article.Parent;

            if (parent != null && parent.IsValid)
            {
                OrderInformations parentInformations = new OrderInformations(parent);

                itemParentLevel = parentInformations.GetComponentLevel();// parent);
                while (!_orderInformationsFromArticles.IsParent(itemParentLevel))
                {
                    parent             = parent.Parent;
                    parentInformations = new OrderInformations(parent);
                    itemParentLevel    = parentInformations.GetComponentLevel();// parent);
                }
                return(parent);
            }
            return(article);
        }
示例#2
0
        private string GetItemLevel(Article article)
        {
            OrderInformations articleInformations = new OrderInformations(article);
            int itemLevel = articleInformations.GetComponentLevel();// article);

            Article parent = article.Parent;

            if (parent != null && parent.IsValid)
            {
                OrderInformations parentInformations = new OrderInformations(parent);
                int priceType = parentInformations.GetPriceType();// parent);
                while (parent.IsValid && parent.KeyRef.StartsWith(KD.StringTools.Const.Underscore) || _orderInformationsFromArticles.IsRegroupPortion(priceType))
                {
                    itemLevel -= 1;
                    parent     = parent.Parent;
                    if (parent == null)
                    {
                        break;
                    }
                    parentInformations = new OrderInformations(parent);
                    priceType          = parentInformations.GetPriceType();// parent);
                }
            }
            return(itemLevel.ToString());
        }
示例#3
0
        public string Add_PlanningSystemItemNumber(Article article)
        {
            if (!String.IsNullOrEmpty(article.Number.ToString())) // && article.Number != KD.Const.UnknownId)
            {
                OrderInformations articleInformations = new OrderInformations(article);

                c506.E1153 = C506.E1153_ON;
                if (utility.HasBlockSet(article))
                {
                    c506.E1154 = RFF_A.BlockSetNumber_ON;
                }
                else
                {
                    int itemLevel  = articleInformations.GetComponentLevel();// article);
                    int childLevel = 1;

                    if (_orderInformationsFromArticles.IsParent(itemLevel))
                    {
                        c506.E1154 = this.SetLineNumber(article, KD.StringTools.Const.Zero);
                    }
                    else
                    {
                        //case of a filer is a component of a Coin, set the number yet
                        if (article.Name.ToUpper().Contains(article.CurrentAppli.GetTranslatedText(CatalogBlockName.Filer.ToUpper())))
                        {
                            c506.E1154 = this.SetLineNumber(article, KD.StringTools.Const.Zero);
                        }
                        else
                        {
                            Article parent           = this.GetParent(article);
                            string  parentChildLevel = this.GetChildLevel(parent, childLevel);

                            childLevelList.Add(parentChildLevel);
                            c506.E1154 = parentChildLevel;
                        }
                    }
                }

                if (c506.E1154.StartsWith(KD.Const.UnknownId.ToString()))
                {
                    return(null);
                }

                OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                //créer deux liste pour EGI REF_POS
                refPosList.Add(article.ObjectId.ToString() + KD.StringTools.Const.SemiColon + c506.E1154);

                if (article.Number != KD.Const.UnknownId)
                {
                    string strNumber = this.SetLineNumber(article, KD.StringTools.Const.Zero);
                    refPosCommentList.Add(article.ObjectId.ToString() + KD.StringTools.Const.SemiColon + strNumber);
                }

                return(this.BuildLine());
            }
            return(null);
        }