Ejemplo n.º 1
0
        public static XQt1485OutBlock FromQuery(XQt1485 query)
        {
            XQt1485OutBlock block = new XQt1485OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.pricejisu = query.GetFieldData(block.GetBlockName(), "pricejisu", 0).ParseFloat("pricejisu"); // float 10.2
                block.sign      = query.GetFieldData(block.GetBlockName(), "sign", 0).FirstOrDefault();             // char 1
                block.change    = query.GetFieldData(block.GetBlockName(), "change", 0).ParseFloat("change");       // float 10.2
                block.volume    = query.GetFieldData(block.GetBlockName(), "volume", 0).ParseLong("volume");        // long 12
                block.yhighjo   = query.GetFieldData(block.GetBlockName(), "yhighjo", 0).ParseLong("yhighjo");      // long 4
                block.yupjo     = query.GetFieldData(block.GetBlockName(), "yupjo", 0).ParseLong("yupjo");          // long 4
                block.yunchgjo  = query.GetFieldData(block.GetBlockName(), "yunchgjo", 0).ParseLong("yunchgjo");    // long 4
                block.ylowjo    = query.GetFieldData(block.GetBlockName(), "ylowjo", 0).ParseLong("ylowjo");        // long 4
                block.ydownjo   = query.GetFieldData(block.GetBlockName(), "ydownjo", 0).ParseLong("ydownjo");      // long 4
                block.ytrajo    = query.GetFieldData(block.GetBlockName(), "ytrajo", 0).ParseLong("ytrajo");        // long 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public XQt1485OutBlock GetBlock()
        {
            XQt1485OutBlock instance = XQt1485OutBlock.FromQuery(this);

            return(instance);
        }