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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1960OutBlock1 block = new XQt1960OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    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).ParseDouble("volume");      // double 12.0
                    block.elwexec    = query.GetFieldData(block.GetBlockName(), "elwexec", i).ParseDouble("elwexec");    // double 10.2
                    block.convrate   = query.GetFieldData(block.GetBlockName(), "convrate", i).ParseDouble("convrate");  // double 12.4
                    block.lastdate   = query.GetFieldData(block.GetBlockName(), "lastdate", i).TrimEnd('?');             // char 8
                    block.itemcode   = query.GetFieldData(block.GetBlockName(), "itemcode", i).TrimEnd('?');             // char 12
                    block.itemshcode = query.GetFieldData(block.GetBlockName(), "itemshcode", i).TrimEnd('?');           // char 9
                    block.itemname   = query.GetFieldData(block.GetBlockName(), "itemname", i).TrimEnd('?');             // char 20
                    block.itemprice  = query.GetFieldData(block.GetBlockName(), "itemprice", i).TrimEnd('?');            // char 10
                    block.itemsign   = query.GetFieldData(block.GetBlockName(), "itemsign", i).FirstOrDefault();         // char 1
                    block.itemchange = query.GetFieldData(block.GetBlockName(), "itemchange", i).TrimEnd('?');           // char 10
                    block.itemdiff   = query.GetFieldData(block.GetBlockName(), "itemdiff", i).ParseDouble("itemdiff");  // double 6.2
                    block.elwshcode  = query.GetFieldData(block.GetBlockName(), "elwshcode", i).TrimEnd('?');            // char 6
                    block.bepoint    = query.GetFieldData(block.GetBlockName(), "bepoint", i).ParseDouble("bepoint");    // double 12.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Ejemplo n.º 2
0
 public XQt1960OutBlock1[] GetBlock1s()
 {
     XQt1960OutBlock1[] instance = XQt1960OutBlock1.ListFromQuery(this);
     return(instance);
 }