Esempio n. 1
0
        public static XQt1826OutBlock[] ListFromQuery(XQt1826 query)
        {
            int count = query.GetBlockCount(XQt1826OutBlock.BlockName);
            List <XQt1826OutBlock> list = new List <XQt1826OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1826OutBlock block = new XQt1826OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.search_cd = query.GetFieldData(block.GetBlockName(), "search_cd", i).TrimEnd('?');                     // char 4
                    block.search_nm = query.GetFieldData(block.GetBlockName(), "search_nm", i).TrimEnd('?');                     // char 40
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 2
0
        public static XQt1826OutBlock[] ReadFromDB(string tableNamePostfix = null /*, char search_gb = default */)
        {
            using (XQt1826 instance = new XQt1826())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt1826OutBlock" : $"XQt1826OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (search_gb != default) qo.Add("search_gb", search_gb);


                var outBlock = instance.SelectMany <XQt1826OutBlock>(qo);
                return(outBlock);
            }
        }
Esempio n. 3
0
        public static XQt1826OutBlock[] Get(char search_gb = default)
        {
            using (XQt1826 instance = new XQt1826())
            {
                instance.SetFieldData(XQt1826InBlock.BlockName, XQt1826InBlock.F.search_gb, 0, search_gb.ToString());                 // char 1

                if (instance.Request() < 0)
                {
                    return(null);
                }

                var outBlock = instance.GetBlocks();
                return(outBlock);
            }
        }