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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8431OutBlock block = new XQt8431OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.hname      = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                 // char 40
                    block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                // char 6
                    block.expcode    = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?');               // char 12
                    block.uplmtprice = query.GetFieldData(block.GetBlockName(), "uplmtprice", i).ParseLong("uplmtprice"); // long 8
                    block.dnlmtprice = query.GetFieldData(block.GetBlockName(), "dnlmtprice", i).ParseLong("dnlmtprice"); // long 8
                    block.jnilclose  = query.GetFieldData(block.GetBlockName(), "jnilclose", i).ParseLong("jnilclose");   // long 8
                    block.recprice   = query.GetFieldData(block.GetBlockName(), "recprice", i).ParseLong("recprice");     // long 8
                } 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 XQt8431OutBlock[] GetBlocks()
 {
     XQt8431OutBlock[] instance = XQt8431OutBlock.ListFromQuery(this);
     return(instance);
 }