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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1104OutBlock1 block = new XQt1104OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.indx = query.GetFieldData(block.GetBlockName(), "indx", i).FirstOrDefault();                 // char 1
                    block.gubn = query.GetFieldData(block.GetBlockName(), "gubn", i).FirstOrDefault();                 // char 1
                    block.vals = query.GetFieldData(block.GetBlockName(), "vals", i).TrimEnd('?');                     // char 8
                } 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 XQt1104OutBlock1[] GetBlock1s()
 {
     XQt1104OutBlock1[] instance = XQt1104OutBlock1.ListFromQuery(this);
     return(instance);
 }