예제 #1
0
        public string GetStandartSize(Position position)
        {
            var ident = GetMaterialIdentification(position);

            if (string.IsNullOrWhiteSpace(ident))
                return string.Empty;

            if (ident.Contains("TUN") || ident.Contains("SN"))
            {
                return string.Empty;
            }

            var splittedIdent = ident.Split('=');
            if (splittedIdent.Length == 3)
            {
                return splittedIdent[2];
            }

            if (splittedIdent.Length == 4)
            {
                return splittedIdent[1];
            }

            return string.Empty;
        }
예제 #2
0
        public int? GetLength(Position position)
        {
            var itemLength = GetStringItemFromPosition(position, ItemsChoiceType.ARTARTRM1);
            if (!string.IsNullOrWhiteSpace(itemLength))
                return GetInt(itemLength);

            return null;
        }
예제 #3
0
        public string GetMarkSteal(Position position)
        {
            var ident = GetMaterialIdentification(position);

            var splittedIdent = ident.Split('=');
            if (splittedIdent.Length == 3)
            {
                return splittedIdent[1];
            }

            return string.Empty;
        }
예제 #4
0
        public int? GetWidth(Position position)
        {
            var varDim = position.ARTARTVarDim;

            if (!string.IsNullOrWhiteSpace(varDim) && varDim.ToLower().Contains("dm"))
            {
                return GetLength(position);
            }

            var itemWidth = GetStringItemFromPosition(position, ItemsChoiceType.ARTARTRM2);
            if (!string.IsNullOrWhiteSpace(itemWidth))
                return GetInt(itemWidth);

            return null;
        }
예제 #5
0
 public bool IsNeedExclude(Position position)
 {
     return false;
 }
예제 #6
0
        public string GetDesignation(Position position)
        {
            var ident = GetMaterialIdentification(position).ToUpper();

            if (string.IsNullOrWhiteSpace(ident))
                return string.Empty;

            if (ident.Contains("TUN") || ident.Contains("SN"))
            {
                var firstPos = string.Empty;
                var secondPos = string.Empty;

                var splitted = ident.Split('=');
                if (splitted.Length == 3 || splitted.Length == 4)
                {
                    firstPos = splitted[0];
                }

                if (splitted.Length == 3)
                {
                    secondPos = splitted[2];
                }

                if (splitted.Length == 4)
                {
                    secondPos = splitted[1];
                }

                return $"{firstPos}={secondPos}".Trim();
            }


            return string.Empty;
        }
예제 #7
0
 private static string GetMaterialIdentification(Position position)
 {
     return string.IsNullOrWhiteSpace(position.ARTARTLtNormLocLn5)
         ? (string.IsNullOrWhiteSpace(position.ARTARTStdDes) ? string.Empty : position.ARTARTStdDes)
         : position.ARTARTLtNormLocLn5;
 }
예제 #8
0
 private static string GetStringItemFromPosition(Position position, ItemsChoiceType itemsChoice)
 {
     var indItemChoice = position.ItemsElementName.ToList().FindIndex(x => x == itemsChoice);
     return indItemChoice >= 0 ? position.Items[indItemChoice] : null;
 }