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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1825OutBlock1 block = new XQt1825OutBlock1();
                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 20
                    block.sign       = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();               // char 1
                    block.signcnt    = query.GetFieldData(block.GetBlockName(), "signcnt", i).ParseLong("signcnt");        // long 3
                    block.close      = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close");            // long 9
                    block.change     = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change");          // long 9
                    block.diff       = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff");             // float 6.2
                    block.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");          // long 10
                    block.volumerate = query.GetFieldData(block.GetBlockName(), "volumerate", i).ParseFloat("volumerate"); // float 6.2
                } 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 XQt1825OutBlock1[] GetBlock1s()
 {
     XQt1825OutBlock1[] instance = XQt1825OutBlock1.ListFromQuery(this);
     return(instance);
 }