private static StockBlockRelationship ParseLine(string line, StockBlockManager manager)
        {
            if (string.IsNullOrWhiteSpace(line))
            {
                return(null);
            }

            var fields = line.Split(_splitter);

            if (fields.Length != FieldCount)
            {
                return(null);
            }

            StockBlock block = manager.GetStockBlockById(fields[2]);

            if (block == null)
            {
                return(null);
            }

            return(new StockBlockRelationship
            {
                StockCode = StockName.NormalizeCode(fields[1]),
                BlockName = block.Name
            });
        }
        public TdxHangYeBlockDataReader(string file, StockBlockManager blockManager)
        {
            if (string.IsNullOrWhiteSpace(file))
            {
                throw new ArgumentNullException();
            }

            var lines = File.ReadAllLines(file, Encoding.GetEncoding("GB2312"));

            foreach (var line in lines)
            {
                var relationship = ParseLine(line, blockManager);
                if (relationship != null)
                {
                    _relationships.Add(relationship);
                }
            }
        }