public static XQt1531OutBlock[] ListFromQuery(XQt1531 query) { int count = query.GetBlockCount(XQt1531OutBlock.BlockName); List <XQt1531OutBlock> list = new List <XQt1531OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1531OutBlock block = new XQt1531OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.tmname = query.GetFieldData(block.GetBlockName(), "tmname", i).TrimEnd('?'); // char 36 block.avgdiff = query.GetFieldData(block.GetBlockName(), "avgdiff", i).ParseFloat("avgdiff"); // float 6.2 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()); }
public XQt1531OutBlock[] GetBlocks() { XQt1531OutBlock[] instance = XQt1531OutBlock.ListFromQuery(this); return(instance); }