Esempio n. 1
0
        public static XQAllOutBlocks Get(char market = default, string upcode = default, char gubun2 = default, char gubun3 = default, string from_date = default, string to_date = default)
        {
            using (XQt1665 instance = new XQt1665())
            {
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.market, 0, market.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.upcode, 0, upcode);                 // char 3
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.gubun2, 0, gubun2.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.gubun3, 0, gubun3.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.from_date, 0, from_date);           // char 8
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.to_date, 0, to_date);               // char 8

                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 XQt1665OutBlock1[] ListFromQuery(XQt1665 query)
        {
            int count = query.GetBlockCount(XQt1665OutBlock1.BlockName);
            List <XQt1665OutBlock1> list = new List <XQt1665OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1665OutBlock1 block = new XQt1665OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date  = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                    // char 8
                    block.sv_08 = query.GetFieldData(block.GetBlockName(), "sv_08", i).ParseLong("sv_08");             // long 12
                    block.sv_17 = query.GetFieldData(block.GetBlockName(), "sv_17", i).ParseLong("sv_17");             // long 12
                    block.sv_18 = query.GetFieldData(block.GetBlockName(), "sv_18", i).ParseLong("sv_18");             // long 12
                    block.sv_01 = query.GetFieldData(block.GetBlockName(), "sv_01", i).ParseLong("sv_01");             // long 12
                    block.sv_03 = query.GetFieldData(block.GetBlockName(), "sv_03", i).ParseLong("sv_03");             // long 12
                    block.sv_04 = query.GetFieldData(block.GetBlockName(), "sv_04", i).ParseLong("sv_04");             // long 12
                    block.sv_02 = query.GetFieldData(block.GetBlockName(), "sv_02", i).ParseLong("sv_02");             // long 12
                    block.sv_05 = query.GetFieldData(block.GetBlockName(), "sv_05", i).ParseLong("sv_05");             // long 12
                    block.sv_06 = query.GetFieldData(block.GetBlockName(), "sv_06", i).ParseLong("sv_06");             // long 12
                    block.sv_07 = query.GetFieldData(block.GetBlockName(), "sv_07", i).ParseLong("sv_07");             // long 12
                    block.sv_00 = query.GetFieldData(block.GetBlockName(), "sv_00", i).ParseLong("sv_00");             // long 12
                    block.sv_09 = query.GetFieldData(block.GetBlockName(), "sv_09", i).ParseLong("sv_09");             // long 12
                    block.sv_10 = query.GetFieldData(block.GetBlockName(), "sv_10", i).ParseLong("sv_10");             // long 12
                    block.sv_11 = query.GetFieldData(block.GetBlockName(), "sv_11", i).ParseLong("sv_11");             // long 12
                    block.sv_99 = query.GetFieldData(block.GetBlockName(), "sv_99", i).ParseLong("sv_99");             // long 12
                    block.sa_08 = query.GetFieldData(block.GetBlockName(), "sa_08", i).ParseDouble("sa_08");           // double 12.0
                    block.sa_17 = query.GetFieldData(block.GetBlockName(), "sa_17", i).ParseDouble("sa_17");           // double 12.0
                    block.sa_18 = query.GetFieldData(block.GetBlockName(), "sa_18", i).ParseDouble("sa_18");           // double 12.0
                    block.sa_01 = query.GetFieldData(block.GetBlockName(), "sa_01", i).ParseDouble("sa_01");           // double 12.0
                    block.sa_03 = query.GetFieldData(block.GetBlockName(), "sa_03", i).ParseDouble("sa_03");           // double 12.0
                    block.sa_04 = query.GetFieldData(block.GetBlockName(), "sa_04", i).ParseDouble("sa_04");           // double 12.0
                    block.sa_02 = query.GetFieldData(block.GetBlockName(), "sa_02", i).ParseDouble("sa_02");           // double 12.0
                    block.sa_05 = query.GetFieldData(block.GetBlockName(), "sa_05", i).ParseDouble("sa_05");           // double 12.0
                    block.sa_06 = query.GetFieldData(block.GetBlockName(), "sa_06", i).ParseDouble("sa_06");           // double 12.0
                    block.sa_07 = query.GetFieldData(block.GetBlockName(), "sa_07", i).ParseDouble("sa_07");           // double 12.0
                    block.sa_00 = query.GetFieldData(block.GetBlockName(), "sa_00", i).ParseDouble("sa_00");           // double 12.0
                    block.sa_09 = query.GetFieldData(block.GetBlockName(), "sa_09", i).ParseDouble("sa_09");           // double 12.0
                    block.sa_10 = query.GetFieldData(block.GetBlockName(), "sa_10", i).ParseDouble("sa_10");           // double 12.0
                    block.sa_11 = query.GetFieldData(block.GetBlockName(), "sa_11", i).ParseDouble("sa_11");           // double 12.0
                    block.sa_99 = query.GetFieldData(block.GetBlockName(), "sa_99", i).ParseDouble("sa_99");           // double 12.0
                    block.jisu  = query.GetFieldData(block.GetBlockName(), "jisu", i).ParseFloat("jisu");              // float 7.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Esempio n. 3
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char market = default,string upcode = default,char gubun2 = default,char gubun3 = default,string from_date = default,string to_date = default */)
        {
            using (XQt1665 instance = new XQt1665())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQt1665OutBlock1" : $"XQt1665OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt1665OutBlock1>(qo);
                return(results);
            }
        }
Esempio n. 4
0
        public static XQt1665OutBlock1[] Get(char market = default, string upcode = default, char gubun2 = default, char gubun3 = default, string from_date = default, string to_date = default)
        {
            using (XQt1665 instance = new XQt1665())
            {
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.market, 0, market.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.upcode, 0, upcode);                 // char 3
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.gubun2, 0, gubun2.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.gubun3, 0, gubun3.ToString());      // char 1
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.from_date, 0, from_date);           // char 8
                instance.SetFieldData(XQt1665InBlock.BlockName, XQt1665InBlock.F.to_date, 0, to_date);               // char 8

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Esempio n. 5
0
        public static XQt1665OutBlock FromQuery(XQt1665 query)
        {
            XQt1665OutBlock block = new XQt1665OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.mcode = query.GetFieldData(block.GetBlockName(), "mcode", 0).TrimEnd('?');                 // char 8
                block.mname = query.GetFieldData(block.GetBlockName(), "mname", 0).TrimEnd('?');                 // char 20
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }