Beispiel #1
0
        private string SetAdd(string information)
        {
            c108   = new C108(information);
            _e4451 = Eancom.FTX_H.E4451_ZZZ + Separator.DataGroup + Separator.DataGroup + Separator.DataGroup;

            OrderWrite.segmentNumberBetweenUNHandUNT += 1;
            return(StructureEDI.FTX_H + Separator.DataGroup + this.E4451 + c108.Add() + Separator.DataGroup + this.E3453 + Separator.EndLine);
        }
        public string Add(Article article)
        {
            string allText  = c108.Add(article);
            string dataLine = null;

            if (!String.IsNullOrEmpty(allText))
            {
                if (allText.Length <= UtilitySegment.freelyWordCharLen)
                {
                    OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                    return(this.BuildLine(allText));
                }

                string partText   = allText;
                int    startIndex = 0;

                for (int c = 0; c < UtilitySegment.freelyLineMaxNb; c++)
                {
                    if (partText.Length > UtilitySegment.freelyWordCharLen)
                    {
                        string text = allText.Substring(startIndex, UtilitySegment.freelyWordCharLen);
                        dataLine += this.BuildLine(text);

                        OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                        startIndex += UtilitySegment.freelyWordCharLen;

                        partText = utility.GetFollowingChar(partText, UtilitySegment.freelyWordCharLen);
                        if (String.IsNullOrEmpty(partText))
                        {
                            return(dataLine);
                        }
                    }
                    else
                    {
                        dataLine += this.BuildLine(partText);

                        OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                        return(dataLine);
                    }
                }
            }
            return(dataLine);
        }
Beispiel #3
0
        private List <string> SetAddComment(string text, int begin, int end, bool isMandatory)
        {
            List <string> FTXCommentList = new List <string>();

            if (!String.IsNullOrEmpty(text))
            {
                int    start         = 0;
                string truncatedText = string.Empty;
                text = text.Replace(KD.StringTools.Const.CrLf, String.Empty);

                for (int line = begin; line < end; line++)
                {
                    if (OrderConstants.CommentSceneCharactersPerLineMax + start > text.Length)
                    {
                        int len = (text.Length - (OrderConstants.CommentSceneCharactersPerLineMax + start));
                        truncatedText = text.Substring(start, (OrderConstants.CommentSceneCharactersPerLineMax + len));
                        truncatedText = this.IsMandatoryAddBracket(isMandatory, truncatedText);
                        c108          = new C108(truncatedText);

                        OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                        FTXCommentList.Add(StructureEDI.FTX_H + Separator.DataGroup + this.E4451 + c108.Add() + Separator.DataGroup + this.E3453 + Separator.EndLine);
                        break;
                    }
                    truncatedText = text.Substring(start, OrderConstants.CommentSceneCharactersPerLineMax);
                    truncatedText = this.IsMandatoryAddBracket(isMandatory, truncatedText);
                    c108          = new C108(truncatedText);

                    OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                    FTXCommentList.Add(StructureEDI.FTX_H + Separator.DataGroup + this.E4451 + c108.Add() + Separator.DataGroup + this.E3453 + Separator.EndLine);
                    start += OrderConstants.CommentSceneCharactersPerLineMax;
                }
            }

            return(FTXCommentList);
        }