コード例 #1
0
        public static XQt8435OutBlock[] ListFromQuery(XQt8435 query)
        {
            int count = query.GetBlockCount(XQt8435OutBlock.BlockName);
            List <XQt8435OutBlock> list = new List <XQt8435OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8435OutBlock block = new XQt8435OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.hname      = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                  // char 20
                    block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                 // char 8
                    block.expcode    = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?');                // char 12
                    block.uplmtprice = query.GetFieldData(block.GetBlockName(), "uplmtprice", i).ParseFloat("uplmtprice"); // float 6.2
                    block.dnlmtprice = query.GetFieldData(block.GetBlockName(), "dnlmtprice", i).ParseFloat("dnlmtprice"); // float 6.2
                    block.jnilclose  = query.GetFieldData(block.GetBlockName(), "jnilclose", i).ParseFloat("jnilclose");   // float 6.2
                    block.jnilhigh   = query.GetFieldData(block.GetBlockName(), "jnilhigh", i).ParseFloat("jnilhigh");     // float 6.2
                    block.jnillow    = query.GetFieldData(block.GetBlockName(), "jnillow", i).ParseFloat("jnillow");       // float 6.2
                    block.recprice   = query.GetFieldData(block.GetBlockName(), "recprice", i).ParseFloat("recprice");     // float 6.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
コード例 #2
0
        public static XQt8435OutBlock[] ReadFromDB(string tableNamePostfix = null /*, string gubun = default */)
        {
            using (XQt8435 instance = new XQt8435())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt8435OutBlock" : $"XQt8435OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (gubun != default) qo.Add("gubun", gubun);


                var outBlock = instance.SelectMany <XQt8435OutBlock>(qo);
                return(outBlock);
            }
        }
コード例 #3
0
        public static XQt8435OutBlock[] Get(string gubun = default)
        {
            using (XQt8435 instance = new XQt8435())
            {
                instance.SetFieldData(XQt8435InBlock.BlockName, XQt8435InBlock.F.gubun, 0, gubun);                 // char 2

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

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