Exemplo n.º 1
0
        public static XQt8436OutBlock[] ReadFromDB(string tableNamePostfix = null /*, char gubun = default */)
        {
            using (XQt8436 instance = new XQt8436())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt8436OutBlock" : $"XQt8436OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (gubun != default) qo.Add("gubun", gubun);


                var outBlock = instance.SelectMany <XQt8436OutBlock>(qo);
                return(outBlock);
            }
        }
Exemplo n.º 2
0
        public static XQt8436OutBlock[] Get(char gubun = default)
        {
            using (XQt8436 instance = new XQt8436())
            {
                instance.SetFieldData(XQt8436InBlock.BlockName, XQt8436InBlock.F.gubun, 0, gubun.ToString());                 // char 1

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

                var outBlock = instance.GetBlocks();
                return(outBlock);
            }
        }
Exemplo n.º 3
0
        public static XQt8436OutBlock[] ListFromQuery(XQt8436 query)
        {
            int count = query.GetBlockCount(XQt8436OutBlock.BlockName);
            List <XQt8436OutBlock> list = new List <XQt8436OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8436OutBlock block = new XQt8436OutBlock();
                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 6
                    block.expcode    = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?');               // char 12
                    block.etfgubun   = query.GetFieldData(block.GetBlockName(), "etfgubun", i).FirstOrDefault();          // char 1
                    block.uplmtprice = query.GetFieldData(block.GetBlockName(), "uplmtprice", i).ParseLong("uplmtprice"); // long 8
                    block.dnlmtprice = query.GetFieldData(block.GetBlockName(), "dnlmtprice", i).ParseLong("dnlmtprice"); // long 8
                    block.jnilclose  = query.GetFieldData(block.GetBlockName(), "jnilclose", i).ParseLong("jnilclose");   // long 8
                    block.memedan    = query.GetFieldData(block.GetBlockName(), "memedan", i).TrimEnd('?');               // char 5
                    block.recprice   = query.GetFieldData(block.GetBlockName(), "recprice", i).ParseLong("recprice");     // long 8
                    block.gubun      = query.GetFieldData(block.GetBlockName(), "gubun", i).FirstOrDefault();             // char 1
                    block.bu12gubun  = query.GetFieldData(block.GetBlockName(), "bu12gubun", i).TrimEnd('?');             // char 2
                    block.spac_gubun = query.GetFieldData(block.GetBlockName(), "spac_gubun", i).FirstOrDefault();        // char 1
                    block.filler     = query.GetFieldData(block.GetBlockName(), "filler", i).TrimEnd('?');                // char 32
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }