public static XQt9943OutBlock[] ListFromQuery(XQt9943 query) { int count = query.GetBlockCount(XQt9943OutBlock.BlockName); List <XQt9943OutBlock> list = new List <XQt9943OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt9943OutBlock block = new XQt9943OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.hname = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?'); // char 20 block.shcode = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?'); // char 8 block.expcode = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?'); // char 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt9943OutBlock[] GetBlocks() { XQt9943OutBlock[] instance = XQt9943OutBlock.ListFromQuery(this); return(instance); }