Example #1
0
        public static XQt1752OutBlock1[] ListFromQuery(XQt1752 query)
        {
            int count = query.GetBlockCount(XQt1752OutBlock1.BlockName);
            List <XQt1752OutBlock1> list = new List <XQt1752OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1752OutBlock1 block = new XQt1752OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.tradname   = query.GetFieldData(block.GetBlockName(), "tradname", i).TrimEnd('?');               // char 20
                    block.tradmdvol  = query.GetFieldData(block.GetBlockName(), "tradmdvol", i).ParseLong("tradmdvol");    // long 12
                    block.tradmsvol  = query.GetFieldData(block.GetBlockName(), "tradmsvol", i).ParseLong("tradmsvol");    // long 12
                    block.tradmssvol = query.GetFieldData(block.GetBlockName(), "tradmssvol", i).ParseLong("tradmssvol");  // long 12
                    block.wintrd     = query.GetFieldData(block.GetBlockName(), "wintrd", i).ParseLong("wintrd");          // long 12
                    block.winrat     = query.GetFieldData(block.GetBlockName(), "winrat", i).ParseFloat("winrat");         // float 6.1
                    block.tradno     = query.GetFieldData(block.GetBlockName(), "tradno", i).TrimEnd('?');                 // char 3
                    block.wgubun     = query.GetFieldData(block.GetBlockName(), "wgubun", i).FirstOrDefault();             // char 1
                    block.swinrat    = query.GetFieldData(block.GetBlockName(), "swinrat", i).ParseFloat("swinrat");       // float 6.1
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Example #2
0
        public static XQt1752OutBlock FromQuery(XQt1752 query)
        {
            XQt1752OutBlock block = new XQt1752OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.fwdvl   = query.GetFieldData(block.GetBlockName(), "fwdvl", 0).ParseLong("fwdvl");               // long 12
                block.fwsvl   = query.GetFieldData(block.GetBlockName(), "fwsvl", 0).ParseLong("fwsvl");               // long 12
                block.cts_idx = query.GetFieldData(block.GetBlockName(), "cts_idx", 0).ParseLong("cts_idx");           // long 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }