예제 #1
0
파일: t1632.cs 프로젝트: iPeterPan/XingAPI
        public static XQt1632OutBlock FromQuery(XQt1632 query)
        {
            XQt1632OutBlock block = new XQt1632OutBlock();

            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.time = query.GetFieldData(block.GetBlockName(), "time", 0).TrimEnd('?');                 // char 6
                block.idx  = query.GetFieldData(block.GetBlockName(), "idx", 0).ParseLong("idx");              // long 4
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
예제 #2
0
파일: t1632.cs 프로젝트: iPeterPan/XingAPI
        public XQt1632OutBlock GetBlock()
        {
            XQt1632OutBlock instance = XQt1632OutBlock.FromQuery(this);

            return(instance);
        }