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

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.ynvolume = query.GetFieldData(block.GetBlockName(), "ynvolume", 0).ParseLong("ynvolume");    // long 8
                block.ysvolume = query.GetFieldData(block.GetBlockName(), "ysvolume", 0).ParseLong("ysvolume");    // long 8
                block.yjvolume = query.GetFieldData(block.GetBlockName(), "yjvolume", 0).ParseLong("yjvolume");    // long 8
                block.yvchange = query.GetFieldData(block.GetBlockName(), "yvchange", 0).ParseLong("yvchange");    // long 8
                block.ygrate   = query.GetFieldData(block.GetBlockName(), "ygrate", 0).ParseFloat("ygrate");       // float 9.2
                block.yjrate   = query.GetFieldData(block.GetBlockName(), "yjrate", 0).ParseFloat("yjrate");       // float 9.2
                block.ynprice  = query.GetFieldData(block.GetBlockName(), "ynprice", 0).ParseLong("ynprice");      // long 8
                block.ysprice  = query.GetFieldData(block.GetBlockName(), "ysprice", 0).ParseLong("ysprice");      // long 8
                block.yjprice  = query.GetFieldData(block.GetBlockName(), "yjprice", 0).ParseLong("yjprice");      // long 8
                block.yachange = query.GetFieldData(block.GetBlockName(), "yachange", 0).ParseLong("yachange");    // long 8
                block.dnvolume = query.GetFieldData(block.GetBlockName(), "dnvolume", 0).ParseLong("dnvolume");    // long 8
                block.dsvolume = query.GetFieldData(block.GetBlockName(), "dsvolume", 0).ParseLong("dsvolume");    // long 8
                block.djvolume = query.GetFieldData(block.GetBlockName(), "djvolume", 0).ParseLong("djvolume");    // long 8
                block.dvchange = query.GetFieldData(block.GetBlockName(), "dvchange", 0).ParseLong("dvchange");    // long 8
                block.dgrate   = query.GetFieldData(block.GetBlockName(), "dgrate", 0).ParseFloat("dgrate");       // float 9.2
                block.djrate   = query.GetFieldData(block.GetBlockName(), "djrate", 0).ParseFloat("djrate");       // float 9.2
                block.dnprice  = query.GetFieldData(block.GetBlockName(), "dnprice", 0).ParseLong("dnprice");      // long 8
                block.dsprice  = query.GetFieldData(block.GetBlockName(), "dsprice", 0).ParseLong("dsprice");      // long 8
                block.djprice  = query.GetFieldData(block.GetBlockName(), "djprice", 0).ParseLong("djprice");      // long 8
                block.dachange = query.GetFieldData(block.GetBlockName(), "dachange", 0).ParseLong("dachange");    // long 8
                block.mmdate   = query.GetFieldData(block.GetBlockName(), "mmdate", 0).TrimEnd('?');               // char 8
                block.close    = query.GetFieldData(block.GetBlockName(), "close", 0).ParseLong("close");          // long 8
                block.volume   = query.GetFieldData(block.GetBlockName(), "volume", 0).ParseLong("volume");        // long 10
                block.value    = query.GetFieldData(block.GetBlockName(), "value", 0).ParseLong("value");          // long 12
                block.pr5days  = query.GetFieldData(block.GetBlockName(), "pr5days", 0).ParseFloat("pr5days");     // float 9.2
                block.pr20days = query.GetFieldData(block.GetBlockName(), "pr20days", 0).ParseFloat("pr20days");   // float 9.2
                block.yj5days  = query.GetFieldData(block.GetBlockName(), "yj5days", 0).ParseFloat("yj5days");     // float 9.2
                block.yj20days = query.GetFieldData(block.GetBlockName(), "yj20days", 0).ParseFloat("yj20days");   // float 9.2
                block.dj5days  = query.GetFieldData(block.GetBlockName(), "dj5days", 0).ParseFloat("dj5days");     // float 9.2
                block.dj20days = query.GetFieldData(block.GetBlockName(), "dj20days", 0).ParseFloat("dj20days");   // float 9.2
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public XQt1926OutBlock GetBlock()
        {
            XQt1926OutBlock instance = XQt1926OutBlock.FromQuery(this);

            return(instance);
        }