Esempio n. 1
0
        public static XRYJCOutBlock FromQuery(XRYJC query)
        {
            XRYJCOutBlock block = new XRYJCOutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.ychetime   = query.GetFieldData(block.GetBlockName(), "ychetime").TrimEnd('?');               // char 6
                block.yeprice    = query.GetFieldData(block.GetBlockName(), "yeprice").ParseLong("yeprice");        // long 10
                block.jnilysign  = query.GetFieldData(block.GetBlockName(), "jnilysign").FirstOrDefault();          // char 1
                block.preychange = query.GetFieldData(block.GetBlockName(), "preychange").ParseLong("preychange");  // long 10
                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);
        }
Esempio n. 2
0
        public XRYJCOutBlock GetBlock()
        {
            XRYJCOutBlock instance = XRYJCOutBlock.FromQuery(this);

            return(instance);
        }