示例#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());
        }
示例#2
0
文件: t9945.cs 项目: tdoobw/XingAPI
        public static XQt9945OutBlock[] ReadFromDB(string tableNamePostfix = null /*, char gubun = default */)
        {
            using (XQt9945 instance = new XQt9945())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt9945OutBlock" : $"XQt9945OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (gubun != default) qo.Add("gubun", gubun);


                var outBlock = instance.SelectMany <XQt9945OutBlock>(qo);
                return(outBlock);
            }
        }
示例#3
0
        public static XQt9945OutBlock[] Get(char gubun = default)
        {
            using (XQt9945 instance = new XQt9945())
            {
                instance.SetFieldData(XQt9945InBlock.BlockName, XQt9945InBlock.F.gubun, 0, gubun.ToString());                 // char 1

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

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