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

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.ksp_cnt = query.GetFieldData(block.GetBlockName(), "ksp_cnt", 0).TrimEnd('?');                 // char 4
                block.ksd_cnt = query.GetFieldData(block.GetBlockName(), "ksd_cnt", 0).TrimEnd('?');                 // char 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Пример #2
0
        public XQt1981OutBlock GetBlock()
        {
            XQt1981OutBlock instance = XQt1981OutBlock.FromQuery(this);

            return(instance);
        }