Beispiel #1
0
        public static XQAllOutBlocks Get(char gubun = default, char gubun1 = default, char gubun2 = default, char gubun3 = default, string fdate = default, string tdate = default, char gubun4 = default, string date = default)
        {
            using (XQt1633 instance = new XQt1633())
            {
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun, 0, gubun.ToString());    // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun1, 0, gubun1.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun2, 0, gubun2.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun3, 0, gubun3.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.fdate, 0, fdate);               // char 8
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.tdate, 0, tdate);               // char 8
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun4, 0, gubun4.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.date, 0, 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);
            }
        }
Beispiel #2
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char gubun = default,char gubun1 = default,char gubun2 = default,char gubun3 = default,string fdate = default,string tdate = default,char gubun4 = default,string date = default */)
        {
            using (XQt1633 instance = new XQt1633())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQt1633OutBlock1" : $"XQt1633OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt1633OutBlock1>(qo);
                return(results);
            }
        }
Beispiel #3
0
        public static XQt1633OutBlock1[] Get(char gubun = default, char gubun1 = default, char gubun2 = default, char gubun3 = default, string fdate = default, string tdate = default, char gubun4 = default, string date = default)
        {
            using (XQt1633 instance = new XQt1633())
            {
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun, 0, gubun.ToString());    // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun1, 0, gubun1.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun2, 0, gubun2.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun3, 0, gubun3.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.fdate, 0, fdate);               // char 8
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.tdate, 0, tdate);               // char 8
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.gubun4, 0, gubun4.ToString());  // char 1
                instance.SetFieldData(XQt1633InBlock.BlockName, XQt1633InBlock.F.date, 0, date);                 // char 8

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Beispiel #4
0
        public static XQt1633OutBlock FromQuery(XQt1633 query)
        {
            XQt1633OutBlock block = new XQt1633OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.date = query.GetFieldData(block.GetBlockName(), "date", 0).TrimEnd('?');                 // char 8
                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);
        }
Beispiel #5
0
        public static XQt1633OutBlock1[] ListFromQuery(XQt1633 query)
        {
            int count = query.GetBlockCount(XQt1633OutBlock1.BlockName);
            List <XQt1633OutBlock1> list = new List <XQt1633OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1633OutBlock1 block = new XQt1633OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date   = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                   // char 8
                    block.jisu   = query.GetFieldData(block.GetBlockName(), "jisu", i).ParseFloat("jisu");             // 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.tot3   = query.GetFieldData(block.GetBlockName(), "tot3", i).ParseLong("tot3");              // long 12
                    block.tot1   = query.GetFieldData(block.GetBlockName(), "tot1", i).ParseLong("tot1");              // long 12
                    block.tot2   = query.GetFieldData(block.GetBlockName(), "tot2", i).ParseLong("tot2");              // long 12
                    block.cha3   = query.GetFieldData(block.GetBlockName(), "cha3", i).ParseLong("cha3");              // long 12
                    block.cha1   = query.GetFieldData(block.GetBlockName(), "cha1", i).ParseLong("cha1");              // long 12
                    block.cha2   = query.GetFieldData(block.GetBlockName(), "cha2", i).ParseLong("cha2");              // long 12
                    block.bcha3  = query.GetFieldData(block.GetBlockName(), "bcha3", i).ParseLong("bcha3");            // long 12
                    block.bcha1  = query.GetFieldData(block.GetBlockName(), "bcha1", i).ParseLong("bcha1");            // long 12
                    block.bcha2  = query.GetFieldData(block.GetBlockName(), "bcha2", i).ParseLong("bcha2");            // long 12
                    block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");          // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }