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

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.result_count = query.GetFieldData(block.GetBlockName(), "result_count", 0).ParseLong("result_count"); // long 5
                block.cont         = query.GetFieldData(block.GetBlockName(), "cont", 0).FirstOrDefault();                  // char 1
                block.cont_key     = query.GetFieldData(block.GetBlockName(), "cont_key", 0).TrimEnd('?');                  // char 40
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Пример #2
0
        public XQt1866OutBlock GetBlock()
        {
            XQt1866OutBlock instance = XQt1866OutBlock.FromQuery(this);

            return(instance);
        }