Esempio n. 1
0
        public static XQt1471OutBlock1[] ListFromQuery(XQt1471 query)
        {
            int count = query.GetBlockCount(XQt1471OutBlock1.BlockName);
            List <XQt1471OutBlock1> list = new List <XQt1471OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1471OutBlock1 block = new XQt1471OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.time         = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?');                      // char 6
                    block.preoffercha1 = query.GetFieldData(block.GetBlockName(), "preoffercha1", i).ParseLong("preoffercha1"); // long 12
                    block.offerrem1    = query.GetFieldData(block.GetBlockName(), "offerrem1", i).ParseLong("offerrem1");       // long 12
                    block.offerho1     = query.GetFieldData(block.GetBlockName(), "offerho1", i).ParseLong("offerho1");         // long 8
                    block.bidho1       = query.GetFieldData(block.GetBlockName(), "bidho1", i).ParseLong("bidho1");             // long 8
                    block.bidrem1      = query.GetFieldData(block.GetBlockName(), "bidrem1", i).ParseLong("bidrem1");           // long 12
                    block.prebidcha1   = query.GetFieldData(block.GetBlockName(), "prebidcha1", i).ParseLong("prebidcha1");     // 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.totsun       = query.GetFieldData(block.GetBlockName(), "totsun", i).ParseLong("totsun");             // long 12
                    block.msrate       = query.GetFieldData(block.GetBlockName(), "msrate", i).ParseFloat("msrate");            // float 6.2
                    block.close        = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close");               // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 2
0
 public XQt1471OutBlock1[] GetBlock1s()
 {
     XQt1471OutBlock1[] instance = XQt1471OutBlock1.ListFromQuery(this);
     return(instance);
 }