public static XQt8426OutBlock[] ListFromQuery(XQt8426 query) { int count = query.GetBlockCount(XQt8426OutBlock.BlockName); List <XQt8426OutBlock> list = new List <XQt8426OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt8426OutBlock block = new XQt8426OutBlock(); 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 XQt8426OutBlock[] GetBlocks() { XQt8426OutBlock[] instance = XQt8426OutBlock.ListFromQuery(this); return(instance); }