public static XQt8436OutBlock[] ListFromQuery(XQt8436 query) { int count = query.GetBlockCount(XQt8436OutBlock.BlockName); List <XQt8436OutBlock> list = new List <XQt8436OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt8436OutBlock block = new XQt8436OutBlock(); 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 6 block.expcode = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?'); // char 12 block.etfgubun = query.GetFieldData(block.GetBlockName(), "etfgubun", i).FirstOrDefault(); // char 1 block.uplmtprice = query.GetFieldData(block.GetBlockName(), "uplmtprice", i).ParseLong("uplmtprice"); // long 8 block.dnlmtprice = query.GetFieldData(block.GetBlockName(), "dnlmtprice", i).ParseLong("dnlmtprice"); // long 8 block.jnilclose = query.GetFieldData(block.GetBlockName(), "jnilclose", i).ParseLong("jnilclose"); // long 8 block.memedan = query.GetFieldData(block.GetBlockName(), "memedan", i).TrimEnd('?'); // char 5 block.recprice = query.GetFieldData(block.GetBlockName(), "recprice", i).ParseLong("recprice"); // long 8 block.gubun = query.GetFieldData(block.GetBlockName(), "gubun", i).FirstOrDefault(); // char 1 block.bu12gubun = query.GetFieldData(block.GetBlockName(), "bu12gubun", i).TrimEnd('?'); // char 2 block.spac_gubun = query.GetFieldData(block.GetBlockName(), "spac_gubun", i).FirstOrDefault(); // char 1 block.filler = query.GetFieldData(block.GetBlockName(), "filler", i).TrimEnd('?'); // char 32 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt8436OutBlock[] GetBlocks() { XQt8436OutBlock[] instance = XQt8436OutBlock.ListFromQuery(this); return(instance); }