Beispiel #1
0
        public static IEnumerable <QueryShareholderRegistryResult> ExtractFrom(TabulateData data)
        {
            if (columnIndices == null)
            {
                columnIndices = columns.Select(c => data.GetColumnIndex(c)).ToArray();
            }

            var subData = data.GetSubColumns(columnIndices);

            foreach (var row in subData.Rows)
            {
                QueryShareholderRegistryResult result = new QueryShareholderRegistryResult();

                int index = 0;
                result.ShareholderCode = row[index++];
                result.Exchange        = row[index] == "0" ? Exchange.ShenzhenExchange : (row[index] == "1" ? Exchange.ShanghaiExchange : null);
                index++;

                result.CapitalAccount = row[index++];
                result.SeatCode       = row[index++];;
                result.Notes          = row[index++];

                yield return(result);
            }
        }
        public IEnumerable <QueryShareholderRegistryResult> QueryShareholderRegistry(out string error)
        {
            TabulateData data;

            if (!QueryData(DataCategory.ShareholderRegistryCode, out data, out error))
            {
                return(new List <QueryShareholderRegistryResult>());
            }

            return(QueryShareholderRegistryResult.ExtractFrom(data));
        }