Пример #1
0
        public static XQt1105OutBlock FromQuery(XQt1105 query)
        {
            XQt1105OutBlock block = new XQt1105OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.shcode = query.GetFieldData(block.GetBlockName(), "shcode", 0).TrimEnd('?');                 // char 6
                block.pbot   = query.GetFieldData(block.GetBlockName(), "pbot", 0).ParseLong("pbot");              // long 8
                block.offer1 = query.GetFieldData(block.GetBlockName(), "offer1", 0).ParseLong("offer1");          // long 8
                block.supp1  = query.GetFieldData(block.GetBlockName(), "supp1", 0).ParseLong("supp1");            // long 8
                block.offer2 = query.GetFieldData(block.GetBlockName(), "offer2", 0).ParseLong("offer2");          // long 8
                block.supp2  = query.GetFieldData(block.GetBlockName(), "supp2", 0).ParseLong("supp2");            // long 8
                block.stdprc = query.GetFieldData(block.GetBlockName(), "stdprc", 0).ParseLong("stdprc");          // long 8
                block.offerd = query.GetFieldData(block.GetBlockName(), "offerd", 0).ParseLong("offerd");          // long 8
                block.suppd  = query.GetFieldData(block.GetBlockName(), "suppd", 0).ParseLong("suppd");            // long 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Пример #2
0
        public XQt1105OutBlock GetBlock()
        {
            XQt1105OutBlock instance = XQt1105OutBlock.FromQuery(this);

            return(instance);
        }