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

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

            return(instance);
        }