Esempio n. 1
0
        public static XQt1825OutBlock1[] ListFromQuery(XQt1825 query)
        {
            int count = query.GetBlockCount(XQt1825OutBlock1.BlockName);
            List <XQt1825OutBlock1> list = new List <XQt1825OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1825OutBlock1 block = new XQt1825OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                 // char 6
                    block.hname      = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                  // char 20
                    block.sign       = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();               // char 1
                    block.signcnt    = query.GetFieldData(block.GetBlockName(), "signcnt", i).ParseLong("signcnt");        // long 3
                    block.close      = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close");            // long 9
                    block.change     = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change");          // long 9
                    block.diff       = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff");             // float 6.2
                    block.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");          // long 10
                    block.volumerate = query.GetFieldData(block.GetBlockName(), "volumerate", i).ParseFloat("volumerate"); // float 6.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 2
0
        public static XQt1825OutBlock1[] Get(string search_cd = default, char gubun = default)
        {
            using (XQt1825 instance = new XQt1825())
            {
                instance.SetFieldData(XQt1825InBlock.BlockName, XQt1825InBlock.F.search_cd, 0, search_cd);                 // char 4
                instance.SetFieldData(XQt1825InBlock.BlockName, XQt1825InBlock.F.gubun, 0, gubun.ToString());              // char 1

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Esempio n. 3
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string search_cd = default,char gubun = default */)
        {
            using (XQt1825 instance = new XQt1825())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQt1825OutBlock1" : $"XQt1825OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt1825OutBlock1>(qo);
                return(results);
            }
        }
Esempio n. 4
0
        public static XQt1825OutBlock FromQuery(XQt1825 query)
        {
            XQt1825OutBlock block = new XQt1825OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.JongCnt = query.GetFieldData(block.GetBlockName(), "JongCnt", 0).ParseLong("JongCnt");                 // long 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Esempio n. 5
0
        public static XQAllOutBlocks Get(string search_cd = default, char gubun = default)
        {
            using (XQt1825 instance = new XQt1825())
            {
                instance.SetFieldData(XQt1825InBlock.BlockName, XQt1825InBlock.F.search_cd, 0, search_cd);                 // char 4
                instance.SetFieldData(XQt1825InBlock.BlockName, XQt1825InBlock.F.gubun, 0, gubun.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);
            }
        }