public static XRJC0OutBlock FromQuery(XRJC0 query) { XRJC0OutBlock block = new XRJC0OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.futcode = query.GetFieldData(block.GetBlockName(), "futcode").TrimEnd('?'); // char 8 block.chetime = query.GetFieldData(block.GetBlockName(), "chetime").TrimEnd('?'); // char 6 block.sign = query.GetFieldData(block.GetBlockName(), "sign").FirstOrDefault(); // char 1 block.change = query.GetFieldData(block.GetBlockName(), "change").ParseLong("change"); // long 10 block.drate = query.GetFieldData(block.GetBlockName(), "drate").ParseDouble("drate"); // double 6.2 block.price = query.GetFieldData(block.GetBlockName(), "price").ParseLong("price"); // long 10 block.open = query.GetFieldData(block.GetBlockName(), "open").ParseLong("open"); // long 10 block.high = query.GetFieldData(block.GetBlockName(), "high").ParseLong("high"); // long 10 block.low = query.GetFieldData(block.GetBlockName(), "low").ParseLong("low"); // long 10 block.cgubun = query.GetFieldData(block.GetBlockName(), "cgubun").FirstOrDefault(); // char 1 block.cvolume = query.GetFieldData(block.GetBlockName(), "cvolume").ParseLong("cvolume"); // long 6 block.volume = query.GetFieldData(block.GetBlockName(), "volume").ParseLong("volume"); // long 12 block.value = query.GetFieldData(block.GetBlockName(), "value").ParseLong("value"); // long 15 block.mdvolume = query.GetFieldData(block.GetBlockName(), "mdvolume").ParseLong("mdvolume"); // long 12 block.mdchecnt = query.GetFieldData(block.GetBlockName(), "mdchecnt").ParseLong("mdchecnt"); // long 8 block.msvolume = query.GetFieldData(block.GetBlockName(), "msvolume").ParseLong("msvolume"); // long 12 block.mschecnt = query.GetFieldData(block.GetBlockName(), "mschecnt").ParseLong("mschecnt"); // long 8 block.cpower = query.GetFieldData(block.GetBlockName(), "cpower").ParseDouble("cpower"); // double 9.2 block.offerho1 = query.GetFieldData(block.GetBlockName(), "offerho1").ParseLong("offerho1"); // long 10 block.bidho1 = query.GetFieldData(block.GetBlockName(), "bidho1").ParseLong("bidho1"); // long 10 block.openyak = query.GetFieldData(block.GetBlockName(), "openyak").ParseLong("openyak"); // long 8 block.k200jisu = query.GetFieldData(block.GetBlockName(), "k200jisu").ParseDouble("k200jisu"); // double 6.2 block.theoryprice = query.GetFieldData(block.GetBlockName(), "theoryprice").ParseLong("theoryprice"); // long 8 block.kasis = query.GetFieldData(block.GetBlockName(), "kasis").ParseDouble("kasis"); // double 6.3 block.sbasis = query.GetFieldData(block.GetBlockName(), "sbasis").ParseLong("sbasis"); // long 6 block.ibasis = query.GetFieldData(block.GetBlockName(), "ibasis").ParseLong("ibasis"); // long 6 block.openyakcha = query.GetFieldData(block.GetBlockName(), "openyakcha").ParseLong("openyakcha"); // long 8 block.jgubun = query.GetFieldData(block.GetBlockName(), "jgubun").TrimEnd('?'); // char 2 block.jnilvolume = query.GetFieldData(block.GetBlockName(), "jnilvolume").ParseLong("jnilvolume"); // long 12 block.basprice = query.GetFieldData(block.GetBlockName(), "basprice").ParseLong("basprice"); // long 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XRJC0OutBlock GetBlock() { XRJC0OutBlock instance = XRJC0OutBlock.FromQuery(this); return(instance); }