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