public static XROX0OutBlock FromQuery(XROX0 query) { XROX0OutBlock block = new XROX0OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.upstep = query.GetFieldData(block.GetBlockName(), "upstep").TrimEnd('?'); // char 2 block.dnstep = query.GetFieldData(block.GetBlockName(), "dnstep").TrimEnd('?'); // char 2 block.uplmtprice = query.GetFieldData(block.GetBlockName(), "uplmtprice").ParseFloat("uplmtprice"); // float 6.2 block.dnlmtprice = query.GetFieldData(block.GetBlockName(), "dnlmtprice").ParseFloat("dnlmtprice"); // float 6.2 block.opttcode = query.GetFieldData(block.GetBlockName(), "opttcode").TrimEnd('?'); // char 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XROX0OutBlock GetBlock() { XROX0OutBlock instance = XROX0OutBlock.FromQuery(this); return(instance); }