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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1533OutBlock block = new XQt1533OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.tmname   = query.GetFieldData(block.GetBlockName(), "tmname", i).TrimEnd('?');                   // char 36
                    block.totcnt   = query.GetFieldData(block.GetBlockName(), "totcnt", i).ParseLong("totcnt");            // long 4
                    block.upcnt    = query.GetFieldData(block.GetBlockName(), "upcnt", i).ParseLong("upcnt");              // long 4
                    block.dncnt    = query.GetFieldData(block.GetBlockName(), "dncnt", i).ParseLong("dncnt");              // long 4
                    block.uprate   = query.GetFieldData(block.GetBlockName(), "uprate", i).ParseFloat("uprate");           // float 6.2
                    block.diff_vol = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol");       // float 10.2
                    block.avgdiff  = query.GetFieldData(block.GetBlockName(), "avgdiff", i).ParseFloat("avgdiff");         // float 6.2
                    block.chgdiff  = query.GetFieldData(block.GetBlockName(), "chgdiff", i).ParseFloat("chgdiff");         // float 6.2
                    block.tmcode   = query.GetFieldData(block.GetBlockName(), "tmcode", i).TrimEnd('?');                   // char 4
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Пример #2
0
 public XQt1533OutBlock[] GetBlocks()
 {
     XQt1533OutBlock[] instance = XQt1533OutBlock.ListFromQuery(this);
     return(instance);
 }