Beispiel #1
0
        public static XQt8429OutBlock1[] ReadFromDB(string tableNamePostfix = null /*, string focode = default,char cgubun = default,int bgubun = default,int cnt = default */)
        {
            using (XQt8429 instance = new XQt8429())
            {
                string      tableName = (tableNamePostfix == null) ? "XQt8429OutBlock1" : $"XQt8429OutBlock1_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                // if (focode != default) qo.Add("focode", focode);
                // if (cgubun != default) qo.Add("cgubun", cgubun);
                // if (bgubun != default) qo.Add("bgubun", bgubun);
                // if (cnt != default) qo.Add("cnt", cnt);


                var outBlock = instance.SelectMany <XQt8429OutBlock1>(qo);
                return(outBlock);
            }
        }
Beispiel #2
0
        public static XQt8429OutBlock1[] Get(string focode = default, char cgubun = default, int bgubun = default, int cnt = default)
        {
            using (XQt8429 instance = new XQt8429())
            {
                instance.SetFieldData(XQt8429InBlock.BlockName, XQt8429InBlock.F.focode, 0, focode);                 // char 8
                instance.SetFieldData(XQt8429InBlock.BlockName, XQt8429InBlock.F.cgubun, 0, cgubun.ToString());      // char 1
                instance.SetFieldData(XQt8429InBlock.BlockName, XQt8429InBlock.F.bgubun, 0, bgubun.ToString("d3"));  // int 3
                instance.SetFieldData(XQt8429InBlock.BlockName, XQt8429InBlock.F.cnt, 0, cnt.ToString("d3"));        // int 3

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Beispiel #3
0
        public static XQt8429OutBlock1[] ListFromQuery(XQt8429 query)
        {
            int count = query.GetBlockCount(XQt8429OutBlock1.BlockName);
            List <XQt8429OutBlock1> list = new List <XQt8429OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8429OutBlock1 block = new XQt8429OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.chetime     = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?');                   // char 10
                    block.price       = query.GetFieldData(block.GetBlockName(), "price", i).ParseFloat("price");              // float 6.2
                    block.sign        = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();                  // char 1
                    block.change      = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");            // float 6.2
                    block.open        = query.GetFieldData(block.GetBlockName(), "open", i).ParseFloat("open");                // float 6.2
                    block.high        = query.GetFieldData(block.GetBlockName(), "high", i).ParseFloat("high");                // float 6.2
                    block.low         = query.GetFieldData(block.GetBlockName(), "low", i).ParseFloat("low");                  // float 6.2
                    block.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).ParseDouble("volume");           // double 12.0
                    block.cvolume     = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");           // long 8
                    block.s_mschecnt  = query.GetFieldData(block.GetBlockName(), "s_mschecnt", i).ParseLong("s_mschecnt");     // long 8
                    block.s_mdchecnt  = query.GetFieldData(block.GetBlockName(), "s_mdchecnt", i).ParseLong("s_mdchecnt");     // long 8
                    block.ss_mschecnt = query.GetFieldData(block.GetBlockName(), "ss_mschecnt", i).ParseLong("ss_mschecnt");   // long 8
                    block.s_mschevol  = query.GetFieldData(block.GetBlockName(), "s_mschevol", i).ParseDouble("s_mschevol");   // double 12.0
                    block.s_mdchevol  = query.GetFieldData(block.GetBlockName(), "s_mdchevol", i).ParseDouble("s_mdchevol");   // double 12.0
                    block.ss_mschevol = query.GetFieldData(block.GetBlockName(), "ss_mschevol", i).ParseDouble("ss_mschevol"); // double 12.0
                    block.chdegvol    = query.GetFieldData(block.GetBlockName(), "chdegvol", i).ParseFloat("chdegvol");        // float 8.2
                    block.chdegcnt    = query.GetFieldData(block.GetBlockName(), "chdegcnt", i).ParseFloat("chdegcnt");        // float 8.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }