public static XQt1631OutBlock FromQuery(XQt1631 query) { XQt1631OutBlock block = new XQt1631OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.cdhrem = query.GetFieldData(block.GetBlockName(), "cdhrem", 0).ParseLong("cdhrem"); // long 8 block.bdhrem = query.GetFieldData(block.GetBlockName(), "bdhrem", 0).ParseLong("bdhrem"); // long 8 block.tcdrem = query.GetFieldData(block.GetBlockName(), "tcdrem", 0).ParseLong("tcdrem"); // long 8 block.tbdrem = query.GetFieldData(block.GetBlockName(), "tbdrem", 0).ParseLong("tbdrem"); // long 8 block.cshrem = query.GetFieldData(block.GetBlockName(), "cshrem", 0).ParseLong("cshrem"); // long 8 block.bshrem = query.GetFieldData(block.GetBlockName(), "bshrem", 0).ParseLong("bshrem"); // long 8 block.tcsrem = query.GetFieldData(block.GetBlockName(), "tcsrem", 0).ParseLong("tcsrem"); // long 8 block.tbsrem = query.GetFieldData(block.GetBlockName(), "tbsrem", 0).ParseLong("tbsrem"); // long 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public static XQt1631OutBlock1[] ListFromQuery(XQt1631 query) { int count = query.GetBlockCount(XQt1631OutBlock1.BlockName); List <XQt1631OutBlock1> list = new List <XQt1631OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1631OutBlock1 block = new XQt1631OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.offervolume = query.GetFieldData(block.GetBlockName(), "offervolume", i).ParseLong("offervolume"); // long 8 block.offervalue = query.GetFieldData(block.GetBlockName(), "offervalue", i).ParseLong("offervalue"); // long 12 block.bidvolume = query.GetFieldData(block.GetBlockName(), "bidvolume", i).ParseLong("bidvolume"); // long 8 block.bidvalue = query.GetFieldData(block.GetBlockName(), "bidvalue", i).ParseLong("bidvalue"); // long 12 block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume"); // long 8 block.value = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }