Ejemplo n.º 1
0
        public static XQt1972OutBlock FromQuery(XQt1972 query)
        {
            XQt1972OutBlock block = new XQt1972OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.hname      = query.GetFieldData(block.GetBlockName(), "hname", 0).TrimEnd('?');                 // char 40
                block.expcode    = query.GetFieldData(block.GetBlockName(), "expcode", 0).TrimEnd('?');               // char 12
                block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", 0).TrimEnd('?');                // char 9
                block.offerno1   = query.GetFieldData(block.GetBlockName(), "offerno1", 0).TrimEnd('?');              // char 6
                block.bidno1     = query.GetFieldData(block.GetBlockName(), "bidno1", 0).TrimEnd('?');                // char 6
                block.dvol1      = query.GetFieldData(block.GetBlockName(), "dvol1", 0).ParseLong("dvol1");           // long 12
                block.svol1      = query.GetFieldData(block.GetBlockName(), "svol1", 0).ParseLong("svol1");           // long 12
                block.dcha1      = query.GetFieldData(block.GetBlockName(), "dcha1", 0).ParseLong("dcha1");           // long 12
                block.scha1      = query.GetFieldData(block.GetBlockName(), "scha1", 0).ParseLong("scha1");           // long 12
                block.ddiff1     = query.GetFieldData(block.GetBlockName(), "ddiff1", 0).ParseFloat("ddiff1");        // float 6.2
                block.sdiff1     = query.GetFieldData(block.GetBlockName(), "sdiff1", 0).ParseFloat("sdiff1");        // float 6.2
                block.offerno2   = query.GetFieldData(block.GetBlockName(), "offerno2", 0).TrimEnd('?');              // char 6
                block.bidno2     = query.GetFieldData(block.GetBlockName(), "bidno2", 0).TrimEnd('?');                // char 6
                block.dvol2      = query.GetFieldData(block.GetBlockName(), "dvol2", 0).ParseLong("dvol2");           // long 12
                block.svol2      = query.GetFieldData(block.GetBlockName(), "svol2", 0).ParseLong("svol2");           // long 12
                block.dcha2      = query.GetFieldData(block.GetBlockName(), "dcha2", 0).ParseLong("dcha2");           // long 12
                block.scha2      = query.GetFieldData(block.GetBlockName(), "scha2", 0).ParseLong("scha2");           // long 12
                block.ddiff2     = query.GetFieldData(block.GetBlockName(), "ddiff2", 0).ParseFloat("ddiff2");        // float 6.2
                block.sdiff2     = query.GetFieldData(block.GetBlockName(), "sdiff2", 0).ParseFloat("sdiff2");        // float 6.2
                block.offerno3   = query.GetFieldData(block.GetBlockName(), "offerno3", 0).TrimEnd('?');              // char 6
                block.bidno3     = query.GetFieldData(block.GetBlockName(), "bidno3", 0).TrimEnd('?');                // char 6
                block.dvol3      = query.GetFieldData(block.GetBlockName(), "dvol3", 0).ParseLong("dvol3");           // long 12
                block.svol3      = query.GetFieldData(block.GetBlockName(), "svol3", 0).ParseLong("svol3");           // long 12
                block.dcha3      = query.GetFieldData(block.GetBlockName(), "dcha3", 0).ParseLong("dcha3");           // long 12
                block.scha3      = query.GetFieldData(block.GetBlockName(), "scha3", 0).ParseLong("scha3");           // long 12
                block.ddiff3     = query.GetFieldData(block.GetBlockName(), "ddiff3", 0).ParseFloat("ddiff3");        // float 6.2
                block.sdiff3     = query.GetFieldData(block.GetBlockName(), "sdiff3", 0).ParseFloat("sdiff3");        // float 6.2
                block.offerno4   = query.GetFieldData(block.GetBlockName(), "offerno4", 0).TrimEnd('?');              // char 6
                block.bidno4     = query.GetFieldData(block.GetBlockName(), "bidno4", 0).TrimEnd('?');                // char 6
                block.dvol4      = query.GetFieldData(block.GetBlockName(), "dvol4", 0).ParseLong("dvol4");           // long 12
                block.svol4      = query.GetFieldData(block.GetBlockName(), "svol4", 0).ParseLong("svol4");           // long 12
                block.dcha4      = query.GetFieldData(block.GetBlockName(), "dcha4", 0).ParseLong("dcha4");           // long 12
                block.scha4      = query.GetFieldData(block.GetBlockName(), "scha4", 0).ParseLong("scha4");           // long 12
                block.ddiff4     = query.GetFieldData(block.GetBlockName(), "ddiff4", 0).ParseFloat("ddiff4");        // float 6.2
                block.sdiff4     = query.GetFieldData(block.GetBlockName(), "sdiff4", 0).ParseFloat("sdiff4");        // float 6.2
                block.offerno5   = query.GetFieldData(block.GetBlockName(), "offerno5", 0).TrimEnd('?');              // char 6
                block.bidno5     = query.GetFieldData(block.GetBlockName(), "bidno5", 0).TrimEnd('?');                // char 6
                block.dvol5      = query.GetFieldData(block.GetBlockName(), "dvol5", 0).ParseLong("dvol5");           // long 12
                block.svol5      = query.GetFieldData(block.GetBlockName(), "svol5", 0).ParseLong("svol5");           // long 12
                block.dcha5      = query.GetFieldData(block.GetBlockName(), "dcha5", 0).ParseLong("dcha5");           // long 12
                block.scha5      = query.GetFieldData(block.GetBlockName(), "scha5", 0).ParseLong("scha5");           // long 12
                block.ddiff5     = query.GetFieldData(block.GetBlockName(), "ddiff5", 0).ParseFloat("ddiff5");        // float 6.2
                block.sdiff5     = query.GetFieldData(block.GetBlockName(), "sdiff5", 0).ParseFloat("sdiff5");        // float 6.2
                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.ftradmdcha = query.GetFieldData(block.GetBlockName(), "ftradmdcha", 0).ParseLong("ftradmdcha"); // long 12
                block.ftradmscha = query.GetFieldData(block.GetBlockName(), "ftradmscha", 0).ParseLong("ftradmscha"); // long 12
                block.fwddiff    = query.GetFieldData(block.GetBlockName(), "fwddiff", 0).ParseFloat("fwddiff");      // float 6.2
                block.fwsdiff    = query.GetFieldData(block.GetBlockName(), "fwsdiff", 0).ParseFloat("fwsdiff");      // float 6.2
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public XQt1972OutBlock GetBlock()
        {
            XQt1972OutBlock instance = XQt1972OutBlock.FromQuery(this);

            return(instance);
        }