Ejemplo n.º 1
0
        public static XQt1954OutBlock FromQuery(XQt1954 query)
        {
            XQt1954OutBlock block = new XQt1954OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.date     = query.GetFieldData(block.GetBlockName(), "date", 0).TrimEnd('?');             // char 8
                block.bsjgubun = query.GetFieldData(block.GetBlockName(), "bsjgubun", 0).FirstOrDefault();     // char 1
                block.bscode   = query.GetFieldData(block.GetBlockName(), "bscode", 0).TrimEnd('?');           // char 6
                block.bjcode   = query.GetFieldData(block.GetBlockName(), "bjcode", 0).TrimEnd('?');           // char 3
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public XQt1954OutBlock GetBlock()
        {
            XQt1954OutBlock instance = XQt1954OutBlock.FromQuery(this);

            return(instance);
        }