Ejemplo n.º 1
0
        public static XQAllOutBlocks Get(char gubun = default, char dgubun = default, string sdate = default, string edate = default)
        {
            using (XQt1631 instance = new XQt1631())
            {
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.gubun, 0, gubun.ToString());      // char 1
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.dgubun, 0, dgubun.ToString());    // char 1
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.sdate, 0, sdate);                 // char 8
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.edate, 0, edate);                 // 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);
            }
        }
Ejemplo n.º 2
0
        public static XQt1631OutBlock FromQuery(XQt1631 query)
        {
            XQt1631OutBlock block = new XQt1631OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.cdhrem = query.GetFieldData(block.GetBlockName(), "cdhrem", 0).ParseLong("cdhrem");                 // long 8
                block.bdhrem = query.GetFieldData(block.GetBlockName(), "bdhrem", 0).ParseLong("bdhrem");                 // long 8
                block.tcdrem = query.GetFieldData(block.GetBlockName(), "tcdrem", 0).ParseLong("tcdrem");                 // long 8
                block.tbdrem = query.GetFieldData(block.GetBlockName(), "tbdrem", 0).ParseLong("tbdrem");                 // long 8
                block.cshrem = query.GetFieldData(block.GetBlockName(), "cshrem", 0).ParseLong("cshrem");                 // long 8
                block.bshrem = query.GetFieldData(block.GetBlockName(), "bshrem", 0).ParseLong("bshrem");                 // long 8
                block.tcsrem = query.GetFieldData(block.GetBlockName(), "tcsrem", 0).ParseLong("tcsrem");                 // long 8
                block.tbsrem = query.GetFieldData(block.GetBlockName(), "tbsrem", 0).ParseLong("tbsrem");                 // long 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 3
0
        public static XQt1631OutBlock1[] ListFromQuery(XQt1631 query)
        {
            int count = query.GetBlockCount(XQt1631OutBlock1.BlockName);
            List <XQt1631OutBlock1> list = new List <XQt1631OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1631OutBlock1 block = new XQt1631OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.offervolume = query.GetFieldData(block.GetBlockName(), "offervolume", i).ParseLong("offervolume");   // long 8
                    block.offervalue  = query.GetFieldData(block.GetBlockName(), "offervalue", i).ParseLong("offervalue");     // long 12
                    block.bidvolume   = query.GetFieldData(block.GetBlockName(), "bidvolume", i).ParseLong("bidvolume");       // long 8
                    block.bidvalue    = query.GetFieldData(block.GetBlockName(), "bidvalue", i).ParseLong("bidvalue");         // long 12
                    block.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");             // long 8
                    block.value       = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value");               // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Ejemplo n.º 4
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char gubun = default,char dgubun = default,string sdate = default,string edate = default */)
        {
            using (XQt1631 instance = new XQt1631())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQt1631OutBlock1" : $"XQt1631OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt1631OutBlock1>(qo);
                return(results);
            }
        }
Ejemplo n.º 5
0
        public static XQt1631OutBlock1[] Get(char gubun = default, char dgubun = default, string sdate = default, string edate = default)
        {
            using (XQt1631 instance = new XQt1631())
            {
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.gubun, 0, gubun.ToString());      // char 1
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.dgubun, 0, dgubun.ToString());    // char 1
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.sdate, 0, sdate);                 // char 8
                instance.SetFieldData(XQt1631InBlock.BlockName, XQt1631InBlock.F.edate, 0, edate);                 // char 8

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }