Esempio n. 1
0
        public static XQAllOutBlocks Get(char qrygb = default, char gubun = default, char signgubun = default, long diff = default, long jc_num = default, long sprice = default, long eprice = default, long volume = default, long idx = default, char jshex = default)
        {
            using (XQt1427 instance = new XQt1427())
            {
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.qrygb, 0, qrygb.ToString());                 // char 1
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.gubun, 0, gubun.ToString());                 // char 1
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.signgubun, 0, signgubun.ToString());         // char 1
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.diff, 0, diff.ToString("d3"));               // long 3
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.jc_num, 0, jc_num.ToString("d12"));          // long 12
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.sprice, 0, sprice.ToString("d8"));           // long 8
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.eprice, 0, eprice.ToString("d8"));           // long 8
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.volume, 0, volume.ToString("d12"));          // long 12
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.idx, 0, idx.ToString("d4"));                 // long 4
                instance.SetFieldData(XQt1427InBlock.BlockName, XQt1427InBlock.F.jshex, 0, jshex.ToString());                 // char 1

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

                XQAllOutBlocks results = new XQAllOutBlocks();
                results.OutBlock = instance.GetBlock();
                if (results.OutBlock.IsValidData == false)
                {
                    return(null);
                }

                results.OutBlock1 = instance.GetBlock1s();
                return(results);
            }
        }
Esempio n. 2
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char qrygb = default,char gubun = default,char signgubun = default,long diff = default,long jc_num = default,long sprice = default,long eprice = default,long volume = default,long idx = default,char jshex = default */)
        {
            using (XQt1427 instance = new XQt1427())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

                string      tableName = (tableNamePostfix == null) ? "XQt1427OutBlock" : $"XQt1427OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                results.OutBlock = instance.Select <XQt1427OutBlock>(qo);

                tableName         = (tableNamePostfix == null) ? "XQt1427OutBlock1" : $"XQt1427OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt1427OutBlock1>(qo);
                return(results);
            }
        }
Esempio n. 3
0
        public static XQt1427OutBlock1[] ListFromQuery(XQt1427 query)
        {
            int count = query.GetBlockCount(XQt1427OutBlock1.BlockName);
            List <XQt1427OutBlock1> list = new List <XQt1427OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1427OutBlock1 block = new XQt1427OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.hname      = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                 // char 20
                    block.price      = query.GetFieldData(block.GetBlockName(), "price", i).ParseLong("price");           // long 8
                    block.sign       = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();              // char 1
                    block.change     = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change");         // long 8
                    block.diff       = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff");            // float 6.2
                    block.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");         // long 12
                    block.diff_vol   = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol");    // float 10.2
                    block.lmtprice   = query.GetFieldData(block.GetBlockName(), "lmtprice", i).ParseLong("lmtprice");     // long 8
                    block.rate       = query.GetFieldData(block.GetBlockName(), "rate", i).ParseFloat("rate");            // float 12.2
                    block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                // char 6
                    block.jnilvolume = query.GetFieldData(block.GetBlockName(), "jnilvolume", i).ParseLong("jnilvolume"); // long 12
                    block.open       = query.GetFieldData(block.GetBlockName(), "open", i).ParseLong("open");             // long 8
                    block.high       = query.GetFieldData(block.GetBlockName(), "high", i).ParseLong("high");             // long 8
                    block.low        = query.GetFieldData(block.GetBlockName(), "low", i).ParseLong("low");               // long 8
                    block.lmtdaycnt  = query.GetFieldData(block.GetBlockName(), "lmtdaycnt", i).ParseLong("lmtdaycnt");   // long 8
                    block.value      = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value");           // long 12
                    block.total      = query.GetFieldData(block.GetBlockName(), "total", i).ParseLong("total");           // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 4
0
        public static XQt1427OutBlock FromQuery(XQt1427 query)
        {
            XQt1427OutBlock block = new XQt1427OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.cnt = query.GetFieldData(block.GetBlockName(), "cnt", 0).ParseLong("cnt");                 // long 4
                block.idx = query.GetFieldData(block.GetBlockName(), "idx", 0).ParseLong("idx");                 // long 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }