Exemplo n.º 1
0
        public static XQt8407OutBlock1[] ListFromQuery(XQt8407 query)
        {
            int count = query.GetBlockCount(XQt8407OutBlock1.BlockName);
            List <XQt8407OutBlock1> list = new List <XQt8407OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8407OutBlock1 block = new XQt8407OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.shcode      = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                  // char 6
                    block.hname       = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                   // char 40
                    block.price       = query.GetFieldData(block.GetBlockName(), "price", i).ParseLong("price");             // long 8
                    block.sign        = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();                // char 1
                    block.change      = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change");           // long 8
                    block.diff        = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff");              // float 6.2
                    block.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");           // long 12
                    block.offerho     = query.GetFieldData(block.GetBlockName(), "offerho", i).ParseLong("offerho");         // long 8
                    block.bidho       = query.GetFieldData(block.GetBlockName(), "bidho", i).ParseLong("bidho");             // long 8
                    block.cvolume     = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");         // long 8
                    block.chdegree    = query.GetFieldData(block.GetBlockName(), "chdegree", i).ParseFloat("chdegree");      // float 9.2
                    block.open        = query.GetFieldData(block.GetBlockName(), "open", i).ParseLong("open");               // long 8
                    block.high        = query.GetFieldData(block.GetBlockName(), "high", i).ParseLong("high");               // long 8
                    block.low         = query.GetFieldData(block.GetBlockName(), "low", i).ParseLong("low");                 // long 8
                    block.value       = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value");             // long 12
                    block.offerrem    = query.GetFieldData(block.GetBlockName(), "offerrem", i).ParseLong("offerrem");       // long 12
                    block.bidrem      = query.GetFieldData(block.GetBlockName(), "bidrem", i).ParseLong("bidrem");           // long 12
                    block.totofferrem = query.GetFieldData(block.GetBlockName(), "totofferrem", i).ParseLong("totofferrem"); // long 12
                    block.totbidrem   = query.GetFieldData(block.GetBlockName(), "totbidrem", i).ParseLong("totbidrem");     // long 12
                    block.jnilclose   = query.GetFieldData(block.GetBlockName(), "jnilclose", i).ParseLong("jnilclose");     // long 8
                    block.uplmtprice  = query.GetFieldData(block.GetBlockName(), "uplmtprice", i).ParseLong("uplmtprice");   // long 8
                    block.dnlmtprice  = query.GetFieldData(block.GetBlockName(), "dnlmtprice", i).ParseLong("dnlmtprice");   // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
 public XQt8407OutBlock1[] GetBlock1s()
 {
     XQt8407OutBlock1[] instance = XQt8407OutBlock1.ListFromQuery(this);
     return(instance);
 }