Exemplo n.º 1
0
        public static XQAllOutBlocks Get(string fdate = default, string tdate = default, char gubun = default, string key_date = default, string upcode = default, int cnt = default)
        {
            using (XQt8428 instance = new XQt8428())
            {
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.fdate, 0, fdate);                 // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.tdate, 0, tdate);                 // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.gubun, 0, gubun.ToString());      // char 1
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.key_date, 0, key_date);           // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.upcode, 0, upcode);               // char 3
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.cnt, 0, cnt.ToString("d3"));      // int 3

                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);
            }
        }
Exemplo n.º 2
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string fdate = default,string tdate = default,char gubun = default,string key_date = default,string upcode = default,int cnt = default */)
        {
            using (XQt8428 instance = new XQt8428())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8428OutBlock1 block = new XQt8428OutBlock1();
                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 7.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.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.custmoney = query.GetFieldData(block.GetBlockName(), "custmoney", i).ParseLong("custmoney"); // long 12
                    block.yecha     = query.GetFieldData(block.GetBlockName(), "yecha", i).ParseLong("yecha");         // long 12
                    block.vol       = query.GetFieldData(block.GetBlockName(), "vol", i).ParseFloat("vol");            // float 6.2
                    block.outmoney  = query.GetFieldData(block.GetBlockName(), "outmoney", i).ParseLong("outmoney");   // long 12
                    block.trjango   = query.GetFieldData(block.GetBlockName(), "trjango", i).ParseLong("trjango");     // long 12
                    block.futymoney = query.GetFieldData(block.GetBlockName(), "futymoney", i).ParseLong("futymoney"); // long 12
                    block.stkmoney  = query.GetFieldData(block.GetBlockName(), "stkmoney", i).ParseLong("stkmoney");   // long 8
                    block.mstkmoney = query.GetFieldData(block.GetBlockName(), "mstkmoney", i).ParseLong("mstkmoney"); // long 8
                    block.mbndmoney = query.GetFieldData(block.GetBlockName(), "mbndmoney", i).ParseLong("mbndmoney"); // long 8
                    block.bndmoney  = query.GetFieldData(block.GetBlockName(), "bndmoney", i).ParseLong("bndmoney");   // long 8
                    block.bndsmoney = query.GetFieldData(block.GetBlockName(), "bndsmoney", i).ParseLong("bndsmoney"); // long 8
                    block.mmfmoney  = query.GetFieldData(block.GetBlockName(), "mmfmoney", i).ParseLong("mmfmoney");   // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemplo n.º 4
0
        public static XQt8428OutBlock1[] Get(string fdate = default, string tdate = default, char gubun = default, string key_date = default, string upcode = default, int cnt = default)
        {
            using (XQt8428 instance = new XQt8428())
            {
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.fdate, 0, fdate);                 // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.tdate, 0, tdate);                 // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.gubun, 0, gubun.ToString());      // char 1
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.key_date, 0, key_date);           // char 8
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.upcode, 0, upcode);               // char 3
                instance.SetFieldData(XQt8428InBlock.BlockName, XQt8428InBlock.F.cnt, 0, cnt.ToString("d3"));      // int 3

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Exemplo n.º 5
0
        public static XQt8428OutBlock FromQuery(XQt8428 query)
        {
            XQt8428OutBlock block = new XQt8428OutBlock();

            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);
        }