public static XQt1617OutBlock1[] ListFromQuery(XQt1617 query) { int count = query.GetBlockCount(XQt1617OutBlock1.BlockName); List <XQt1617OutBlock1> list = new List <XQt1617OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1617OutBlock1 block = new XQt1617OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.date = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?'); // char 8 block.time = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?'); // char 8 block.sv_08 = query.GetFieldData(block.GetBlockName(), "sv_08", i).ParseLong("sv_08"); // long 12 block.sv_17 = query.GetFieldData(block.GetBlockName(), "sv_17", i).ParseLong("sv_17"); // long 12 block.sv_18 = query.GetFieldData(block.GetBlockName(), "sv_18", i).ParseLong("sv_18"); // long 12 block.sv_01 = query.GetFieldData(block.GetBlockName(), "sv_01", i).ParseLong("sv_01"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1617OutBlock1[] GetBlock1s() { XQt1617OutBlock1[] instance = XQt1617OutBlock1.ListFromQuery(this); return(instance); }