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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt9945OutBlock block = new XQt9945OutBlock();
                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.etfchk  = query.GetFieldData(block.GetBlockName(), "etfchk", i).FirstOrDefault();              // char 1
                    block.filler  = query.GetFieldData(block.GetBlockName(), "filler", i).TrimEnd('?');                  // char 5
                } 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 XQt9945OutBlock[] GetBlocks()
 {
     XQt9945OutBlock[] instance = XQt9945OutBlock.ListFromQuery(this);
     return(instance);
 }