public static XQt1857OutBlock FromQuery(XQt1857 query) { XQt1857OutBlock block = new XQt1857OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.result_count = query.GetFieldData(block.GetBlockName(), "result_count", 0).ParseLong("result_count"); // long 5 block.result_time = query.GetFieldData(block.GetBlockName(), "result_time", 0).TrimEnd('?'); // char 6 block.AlertNum = query.GetFieldData(block.GetBlockName(), "AlertNum", 0).TrimEnd('?'); // char 11 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt1857OutBlock GetBlock() { XQt1857OutBlock instance = XQt1857OutBlock.FromQuery(this); return(instance); }