public static XQt0167OutBlock FromQuery(XQt0167 query) { XQt0167OutBlock block = new XQt0167OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.dt = query.GetFieldData(block.GetBlockName(), "dt", 0).TrimEnd('?'); // char 8 block.time = query.GetFieldData(block.GetBlockName(), "time", 0).TrimEnd('?'); // char 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt0167OutBlock GetBlock() { XQt0167OutBlock instance = XQt0167OutBlock.FromQuery(this); return(instance); }