Пример #1
0
        public static XQt4201OutBlock1[] ListFromQuery(XQt4201 query)
        {
            int count = query.GetBlockCount(XQt4201OutBlock1.BlockName);
            List <XQt4201OutBlock1> list = new List <XQt4201OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt4201OutBlock1 block = new XQt4201OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date      = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                // char 8
                    block.time      = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?');                // char 10
                    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.close     = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close");         // long 8
                    block.jdiff_vol = query.GetFieldData(block.GetBlockName(), "jdiff_vol", i).ParseLong("jdiff_vol"); // long 12
                    block.value     = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value");         // long 12
                    block.jongchk   = query.GetFieldData(block.GetBlockName(), "jongchk", i).ParseLong("jongchk");     // long 13
                    block.rate      = query.GetFieldData(block.GetBlockName(), "rate", i).ParseDouble("rate");         // double 6.2
                    block.pricechk  = query.GetFieldData(block.GetBlockName(), "pricechk", i).ParseLong("pricechk");   // long 13
                    block.ratevalue = query.GetFieldData(block.GetBlockName(), "ratevalue", i).ParseLong("ratevalue"); // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Пример #2
0
 public XQt4201OutBlock1[] GetBlock1s()
 {
     XQt4201OutBlock1[] instance = XQt4201OutBlock1.ListFromQuery(this);
     return(instance);
 }