public static XQt1764OutBlock[] ListFromQuery(XQt1764 query) { int count = query.GetBlockCount(XQt1764OutBlock.BlockName); List <XQt1764OutBlock> list = new List <XQt1764OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1764OutBlock block = new XQt1764OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.rank = query.GetFieldData(block.GetBlockName(), "rank", i).ParseLong("rank"); // long 4 block.tradno = query.GetFieldData(block.GetBlockName(), "tradno", i).TrimEnd('?'); // char 3 block.tradname = query.GetFieldData(block.GetBlockName(), "tradname", i).TrimEnd('?'); // char 20 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1764OutBlock[] GetBlocks() { XQt1764OutBlock[] instance = XQt1764OutBlock.ListFromQuery(this); return(instance); }