Esempio n. 1
0
        public static XQt8427OutBlock FromQuery(XQt8427 query)
        {
            XQt8427OutBlock block = new XQt8427OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.focode = query.GetFieldData(block.GetBlockName(), "focode", 0).TrimEnd('?');             // char 8
                block.date   = query.GetFieldData(block.GetBlockName(), "date", 0).TrimEnd('?');               // char 8
                block.time   = query.GetFieldData(block.GetBlockName(), "time", 0).TrimEnd('?');               // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Esempio n. 2
0
        public XQt8427OutBlock GetBlock()
        {
            XQt8427OutBlock instance = XQt8427OutBlock.FromQuery(this);

            return(instance);
        }