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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt3401OutBlock1 block = new XQt3401OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.shcode   = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');               // char 9
                    block.tradno   = query.GetFieldData(block.GetBlockName(), "tradno", i).TrimEnd('?');               // char 3
                    block.date     = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                 // char 8
                    block.tradname = query.GetFieldData(block.GetBlockName(), "tradname", i).TrimEnd('?');             // char 30
                    block.bopn     = query.GetFieldData(block.GetBlockName(), "bopn", i).TrimEnd('?');                 // char 30
                    block.nopn     = query.GetFieldData(block.GetBlockName(), "nopn", i).TrimEnd('?');                 // char 30
                    block.boga     = query.GetFieldData(block.GetBlockName(), "boga", i).ParseLong("boga");            // long 12
                    block.noga     = query.GetFieldData(block.GetBlockName(), "noga", i).ParseLong("noga");            // long 12
                    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());
        }
Ejemplo n.º 2
0
 public XQt3401OutBlock1[] GetBlock1s()
 {
     XQt3401OutBlock1[] instance = XQt3401OutBlock1.ListFromQuery(this);
     return(instance);
 }