예제 #1
0
파일: t8425.cs 프로젝트: iPeterPan/XingAPI
        public static XQt8425OutBlock[] ListFromQuery(XQt8425 query)
        {
            int count = query.GetBlockCount(XQt8425OutBlock.BlockName);
            List <XQt8425OutBlock> list = new List <XQt8425OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8425OutBlock block = new XQt8425OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.tmname = query.GetFieldData(block.GetBlockName(), "tmname", i).TrimEnd('?');                     // char 36
                    block.tmcode = query.GetFieldData(block.GetBlockName(), "tmcode", i).TrimEnd('?');                     // char 4
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
예제 #2
0
파일: t8425.cs 프로젝트: iPeterPan/XingAPI
 public XQt8425OutBlock[] GetBlocks()
 {
     XQt8425OutBlock[] instance = XQt8425OutBlock.ListFromQuery(this);
     return(instance);
 }