Example #1
0
        public static XRCD0OutBlock FromQuery(XRCD0 query)
        {
            XRCD0OutBlock block = new XRCD0OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.gubun         = query.GetFieldData(block.GetBlockName(), "gubun").FirstOrDefault();                    // char 1
                block.dy_gubun      = query.GetFieldData(block.GetBlockName(), "dy_gubun").FirstOrDefault();                 // char 1
                block.dy_uplmtprice = query.GetFieldData(block.GetBlockName(), "dy_uplmtprice").ParseFloat("dy_uplmtprice"); // float 8.2
                block.dy_dnlmtprice = query.GetFieldData(block.GetBlockName(), "dy_dnlmtprice").ParseFloat("dy_dnlmtprice"); // float 8.2
                block.futcode       = query.GetFieldData(block.GetBlockName(), "futcode").TrimEnd('?');                      // char 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Example #2
0
        public XRCD0OutBlock GetBlock()
        {
            XRCD0OutBlock instance = XRCD0OutBlock.FromQuery(this);

            return(instance);
        }