示例#1
0
 public LIN_A(OrderInformations orderInformationsFromArticles, string consecutiveNumbering, FileEDI fileEDI)
 {
     _orderInformationsFromArticles = orderInformationsFromArticles;
     _fileEDI = fileEDI;
     c212     = new C212();
     _consecutiveNumbering = consecutiveNumbering;
 }
示例#2
0
 public PIA_H(OrderInformations orderInformationsFromArticles, FileEDI fileEDI)
 {
     _orderInformationsFromArticles = orderInformationsFromArticles;
     c212     = new C212();
     _fileEDI = fileEDI;
     utility  = new UtilitySegment();
 }
示例#3
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);
        }
示例#4
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());
        }
示例#5
0
 public NAD(OrderInformations orderInformations, FileEDI fileEDI)
 {
     _orderInformations = orderInformations;
     _fileEDI           = fileEDI;
     c082 = new C082();
     c080 = new C080();
     c059 = new C059();
 }
示例#6
0
 public UNB(OrderInformations orderInformations, FileEDI fileEDI)
 {
     _orderInformations = orderInformations;
     _fileEDI           = fileEDI;
     s001 = new S001();
     s002 = new S002();
     s003 = new S003();
     s004 = new S004();
 }
示例#7
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);
        }
示例#8
0
        public FileEDI(AppliComponent appli, OrderInformations orderInformationsFromArticles, string articleRef)
        {
            _currentAppli = appli;
            _orderInformationsFromArticles = orderInformationsFromArticles;
            this.appairingCSVFileName      = _orderInformationsFromArticles.GetEachPairingCSVFileName(this.RootCsvPairingFileName(), articleRef);
            rowList.Clear();

            this.OpenCsvPairingFile(articleRef);
        }
示例#9
0
        public FileEDI(AppliComponent appli, string supplierName, OrderInformations orderInformationsFromArticles)
        {
            _currentAppli = appli;
            _supplierName = supplierName;
            _orderInformationsFromArticles = orderInformationsFromArticles;
            this.appairingCSVFileName      = _orderInformationsFromArticles.GetFirstPairingCSVFileName(this.RootCsvPairingFileName());
            rowList.Clear();

            this.OpenCsvPairingFile(String.Empty);
        }
示例#10
0
            public string Add(Article article)
            {
                OrderInformations articleInformations = new OrderInformations(article);

                _e4440 = articleInformations.GetSupplierCommentArticle();// article);

                if (!String.IsNullOrEmpty(this.E4440))
                {
                    return(this.E4440);
                }
                return(null);
            }
示例#11
0
        public string Add(Article article)
        {
            SegmentClassification segmentClassification = new SegmentClassification(article);
            OrderInformations     articleInformations   = new OrderInformations(article, segmentClassification);
            string dataLine = null;

            if (articleInformations.IsOption_MEA(_fileEDI))
            {
                double dimX = this.DimensionX(article, segmentClassification);
                double dimY = article.DimensionY;
                double dimZ = article.DimensionZ;

                if (segmentClassification.IsArticleUnit() && (!segmentClassification.IsArticleSplashbackPanel() | !segmentClassification.IsArticleSplashbackPanel2()))
                {
                    dimY -= (OrderConstants.FrontDepth - 1);
                }

                if (segmentClassification.IsArticleSplashbackPanelShape() || segmentClassification.IsArticleSplashbackPanelShape2())
                {
                    double dimT = dimY;
                    dimY = dimZ;
                    dimZ = dimT;
                }

                List <double> dimensionList = new List <double>()
                {
                    dimX, dimY, dimZ
                };
                List <string> measureCodeList = new List <string>()
                {
                    MEA.Width, MEA.Depth, MEA.Height
                };
                int index = 0;

                foreach (double dimension in dimensionList)
                {
                    if (utility.IsDimensionValid(dimension))
                    {
                        OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                        dataLine += StructureEDI.MEA + Separator.DataGroup + E6311 + c502.Add(measureCodeList[index]) + c174.Add(dimension) + Separator.EndLine;
                    }
                    index += 1;
                }
            }
            return(dataLine);
        }
示例#12
0
        public string Add_LongPartType(Article article)
        {
            if (utility.HasBlockSet(article))
            {
                _e4347     = PIA_A.E4347_1;
                c212.E7140 = C212.E7140_100;
                c212.E7143 = C212.E7143_BK;
                c212.E3055 = C212.E3055_91;

                OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                return(this.BuildLine());
            }
            else
            {
                OrderInformations articleInformations = new OrderInformations(article);
                List <string>     codeAndNameList     = new List <string>();

                codeAndNameList = articleInformations.GetFinishCodeAndName();// article);
                if (codeAndNameList != null && codeAndNameList.Count > 0)
                {
                    foreach (string codeAndNameLine in codeAndNameList)
                    {
                        string[] codeAndName = codeAndNameLine.Split(KD.CharTools.Const.SemiColon);
                        if (codeAndName.Length == 4)
                        {
                            _e4347     = PIA_A.E4347_1;
                            c212.E7140 = utility.GetLongPartType(codeAndName[3]);
                            c212.E7143 = C212.E7143_BK;
                            c212.E3055 = C212.E3055_91;

                            if (!String.IsNullOrEmpty(c212.E7140))
                            {
                                OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                                return(this.BuildLine());
                            }
                        }
                    }
                }
            }
            return(null);
        }
示例#13
0
 public C108(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
 }
示例#14
0
 public string Add(OrderInformations orderInformationsFromArticles)
 {
     return(this.E7140 + Separator.DataElement + this.E7143 + Separator.DataElement + Separator.DataElement + E3055);
 }
示例#15
0
 public BGM(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
 }
示例#16
0
        public string Add_FinishCodeAndName(Article article)
        {
            string        dataLine = null;
            List <string> GenericCodeAndNameList = new List <string>();

            GenericCodeAndNameList = _orderInformationsFromArticles.GetGenericCatalogFinishCodeAndName();

            if (GenericCodeAndNameList != null && GenericCodeAndNameList.Count > 0)
            {
                OrderInformations articleInformations = new OrderInformations(article);
                List <string>     codeAndNameList     = new List <string>();

                codeAndNameList = articleInformations.GetFinishCodeAndName();// article);
                if (codeAndNameList != null && codeAndNameList.Count > 0)
                {
                    //foreach (string codeAndNameLine in codeAndNameList)
                    //{
                    for (int i = 0; i < codeAndNameList.Count; i++)
                    {
                        //string codeAndNameLine = codeAndNameList[i];
                        if (codeAndNameList[i].StartsWith(OrderConstants.IdemFinishCode) || !GenericCodeAndNameList.Contains(codeAndNameList[i]))
                        {
                            //string[] codeAndName = codeAndNameLine.Split(KD.CharTools.Const.SemiColon);
                            string[] codeAndName = codeAndNameList[i].Split(KD.CharTools.Const.SemiColon);
                            if (codeAndName.Length == 4)
                            {
                                string code = Tools.DelCharAndAllAfter(codeAndName[0], KD.StringTools.Const.Underscore);
                                code = Tools.DelCharAndAllAfter(code, KD.StringTools.Const.Colon);
                                code = _orderInformationsFromArticles.ReleaseChar(code);

                                if (utility.IsAssemblyWorktop(codeAndName[3]))
                                {
                                    continue;
                                }
                                string name = codeAndName[2];
                                name = _orderInformationsFromArticles.ReleaseChar(name);

                                // put the same code an name when code = IDEM
                                if (code == OrderConstants.IdemFinishCode)
                                {
                                    if (i >= 1 & codeAndNameList[i - 1] != null & !String.IsNullOrEmpty(codeAndNameList[i - 1]))
                                    {
                                        if (GenericCodeAndNameList.Contains(codeAndNameList[i - 1]))
                                        {
                                            continue;
                                        }
                                        string[] idemCodeAndName = codeAndNameList[i - 1].Split(KD.CharTools.Const.SemiColon);
                                        if (idemCodeAndName.Length == 4)
                                        {
                                            code = Tools.DelCharAndAllAfter(idemCodeAndName[0], KD.StringTools.Const.Underscore);
                                            code = Tools.DelCharAndAllAfter(code, KD.StringTools.Const.Colon);
                                            code = _orderInformationsFromArticles.ReleaseChar(code);

                                            name = idemCodeAndName[2];
                                            name = _orderInformationsFromArticles.ReleaseChar(name);
                                        }
                                    }
                                }

                                int nameCharStart = 0;

                                for (int c = 0; c < 2; c++)
                                {
                                    _e4347 = PIA_A.E4347_5;
                                    code   = utility.GetCodeLen(code);

                                    StringBuilder codeStringBuilder = utility.CodeStringBuilder(code);
                                    StringBuilder nameStringBuilder = utility.NameStringBuilder(name, nameCharStart);

                                    c212.E7140 = codeStringBuilder.ToString() + nameStringBuilder.ToString();
                                    c212.E7143 = KD.StringTools.Const.One;
                                    if (!utility.IsModel(codeAndName[3]))
                                    {
                                        c212.E7143 = _fileEDI.FinishTypeVariant(codeAndName[3]);
                                        if (!String.IsNullOrEmpty(c212.E7143) && c212.E7143.Contains(KD.StringTools.Const.Pipe))
                                        {
                                            c212.E7143 = String.Empty;
                                        }
                                    }

                                    c212.E3055 = C212.E3055_91;

                                    if (String.IsNullOrEmpty(code))
                                    {
                                        c212.E3055 = C212.E3055_92;
                                    }

                                    dataLine += BuildLine();

                                    OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                                    nameCharStart += UtilitySegment.nameCharLen;

                                    name = utility.GetFollowingChar(name, UtilitySegment.nameCharLen);
                                    if (String.IsNullOrEmpty(name))
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(dataLine);
        }
示例#17
0
 public FTX_H(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
 }
示例#18
0
 public FTX_A(OrderInformations orderInformations)
 {
     c108    = new C108(orderInformations);
     utility = new UtilitySegment();
 }
示例#19
0
 public UNZ(OrderInformations orderInformations, FileEDI fileEDI) //string e0036, string e0020)
 {
     _orderInformations = orderInformations;
     _fileEDI           = fileEDI;
 }
示例#20
0
 public DTM(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
     c507 = new C507();
 }
示例#21
0
 public RFF_H(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
 }
示例#22
0
 public COM(OrderInformations orderInformations, FileEDI fileEDI)
 {
     _orderInformations = orderInformations;
     _fileEDI           = fileEDI;
 }
示例#23
0
 public RFF_A(OrderInformations orderInformationsFromArticles)
 {
     _orderInformationsFromArticles = orderInformationsFromArticles;
     c506    = new C506();
     utility = new UtilitySegment();
 }
示例#24
0
 public CTA(OrderInformations orderInformations) //string e3139, string e3413, string e3412)
 {
     _orderInformations = orderInformations;
 }
示例#25
0
 public IMD(OrderInformations orderInformationsFromArticles)
 {
     _orderInformationsFromArticles = orderInformationsFromArticles;
     c273 = new C273();
 }
示例#26
0
 public UNT(OrderInformations orderInformations) //string e0074, string e0062)
 {
     _orderInformations = orderInformations;
 }
示例#27
0
 public UNH(OrderInformations orderInformations)
 {
     _orderInformations = orderInformations;
 }