public static XRDVIOutBlock FromQuery(XRDVI query) { XRDVIOutBlock block = new XRDVIOutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.vi_gubun = query.GetFieldData(block.GetBlockName(), "vi_gubun").FirstOrDefault(); // char 1 block.svi_recprice = query.GetFieldData(block.GetBlockName(), "svi_recprice").ParseLong("svi_recprice"); // long 8 block.dvi_recprice = query.GetFieldData(block.GetBlockName(), "dvi_recprice").ParseLong("dvi_recprice"); // long 8 block.vi_trgprice = query.GetFieldData(block.GetBlockName(), "vi_trgprice").ParseLong("vi_trgprice"); // long 8 block.shcode = query.GetFieldData(block.GetBlockName(), "shcode").TrimEnd('?'); // char 6 block.ref_shcode = query.GetFieldData(block.GetBlockName(), "ref_shcode").TrimEnd('?'); // char 6 block.time = query.GetFieldData(block.GetBlockName(), "time").TrimEnd('?'); // char 6 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XRDVIOutBlock GetBlock() { XRDVIOutBlock instance = XRDVIOutBlock.FromQuery(this); return(instance); }