Exemplo n.º 1
0
        public static XRYS3OutBlock FromQuery(XRYS3 query)
        {
            XRYS3OutBlock block = new XRYS3OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.hotime     = query.GetFieldData(block.GetBlockName(), "hotime").TrimEnd('?');                 // char 6
                block.yeprice    = query.GetFieldData(block.GetBlockName(), "yeprice").ParseLong("yeprice");        // long 8
                block.yevolume   = query.GetFieldData(block.GetBlockName(), "yevolume").ParseLong("yevolume");      // long 12
                block.jnilysign  = query.GetFieldData(block.GetBlockName(), "jnilysign").FirstOrDefault();          // char 1
                block.preychange = query.GetFieldData(block.GetBlockName(), "preychange").ParseLong("preychange");  // long 8
                block.jnilydrate = query.GetFieldData(block.GetBlockName(), "jnilydrate").ParseFloat("jnilydrate"); // float 6.2
                block.yofferho0  = query.GetFieldData(block.GetBlockName(), "yofferho0").ParseLong("yofferho0");    // long 8
                block.ybidho0    = query.GetFieldData(block.GetBlockName(), "ybidho0").ParseLong("ybidho0");        // long 8
                block.yofferrem0 = query.GetFieldData(block.GetBlockName(), "yofferrem0").ParseLong("yofferrem0");  // long 12
                block.ybidrem0   = query.GetFieldData(block.GetBlockName(), "ybidrem0").ParseLong("ybidrem0");      // long 12
                block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode").TrimEnd('?');                 // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Exemplo n.º 2
0
        public XRYS3OutBlock GetBlock()
        {
            XRYS3OutBlock instance = XRYS3OutBlock.FromQuery(this);

            return(instance);
        }