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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8424OutBlock block = new XQt8424OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.hname  = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                    // char 20
                    block.upcode = query.GetFieldData(block.GetBlockName(), "upcode", i).TrimEnd('?');                   // char 3
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
 public XQt8424OutBlock[] GetBlocks()
 {
     XQt8424OutBlock[] instance = XQt8424OutBlock.ListFromQuery(this);
     return(instance);
 }