public static XRYFCOutBlock FromQuery(XRYFC query) { XRYFCOutBlock block = new XRYFCOutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.ychetime = query.GetFieldData(block.GetBlockName(), "ychetime").TrimEnd('?'); // char 6 block.yeprice = query.GetFieldData(block.GetBlockName(), "yeprice").ParseFloat("yeprice"); // float 6.2 block.jnilysign = query.GetFieldData(block.GetBlockName(), "jnilysign").FirstOrDefault(); // char 1 block.preychange = query.GetFieldData(block.GetBlockName(), "preychange").ParseFloat("preychange"); // float 6.2 block.jnilydrate = query.GetFieldData(block.GetBlockName(), "jnilydrate").ParseFloat("jnilydrate"); // float 6.2 block.futcode = query.GetFieldData(block.GetBlockName(), "futcode").TrimEnd('?'); // char 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XRYFCOutBlock GetBlock() { XRYFCOutBlock instance = XRYFCOutBlock.FromQuery(this); return(instance); }