예제 #1
0
파일: t1532.cs 프로젝트: iPeterPan/XingAPI
        public static XQt1532OutBlock[] ListFromQuery(XQt1532 query)
        {
            int count = query.GetBlockCount(XQt1532OutBlock.BlockName);
            List <XQt1532OutBlock> list = new List <XQt1532OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1532OutBlock block = new XQt1532OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.tmname  = query.GetFieldData(block.GetBlockName(), "tmname", i).TrimEnd('?');                    // char 36
                    block.avgdiff = query.GetFieldData(block.GetBlockName(), "avgdiff", i).ParseFloat("avgdiff");          // float 6.2
                    block.tmcode  = query.GetFieldData(block.GetBlockName(), "tmcode", i).TrimEnd('?');                    // char 4
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
예제 #2
0
파일: t1532.cs 프로젝트: tdoobw/XingAPI
        public static XQt1532OutBlock[] ReadFromDB(string tableNamePostfix = null /*, string shcode = default */)
        {
            using (XQt1532 instance = new XQt1532())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt1532OutBlock" : $"XQt1532OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (shcode != default) qo.Add("shcode", shcode);


                var outBlock = instance.SelectMany <XQt1532OutBlock>(qo);
                return(outBlock);
            }
        }
예제 #3
0
파일: t1532.cs 프로젝트: iPeterPan/XingAPI
        public static XQt1532OutBlock[] Get(string shcode = default)
        {
            using (XQt1532 instance = new XQt1532())
            {
                instance.SetFieldData(XQt1532InBlock.BlockName, XQt1532InBlock.F.shcode, 0, shcode);                 // char 6

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

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