예제 #1
0
        public static XQMMDAQ91200OutBlock2[] ListFromQuery(XQMMDAQ91200 query)
        {
            int count = query.GetBlockCount(XQMMDAQ91200OutBlock2.BlockName);
            List <XQMMDAQ91200OutBlock2> list = new List <XQMMDAQ91200OutBlock2>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQMMDAQ91200OutBlock2 block = new XQMMDAQ91200OutBlock2();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.IsuSmclssCode     = query.GetFieldData(block.GetBlockName(), "IsuSmclssCode", i).TrimEnd('?');                // char 3
                    block.IsuMdclssCode     = query.GetFieldData(block.GetBlockName(), "IsuMdclssCode", i).TrimEnd('?');                // char 2
                    block.IsuLrgMdclssNm    = query.GetFieldData(block.GetBlockName(), "IsuLrgMdclssNm", i).TrimEnd('?');               // char 40
                    block.IsuLrgMidSmclssNm = query.GetFieldData(block.GetBlockName(), "IsuLrgMidSmclssNm", i).TrimEnd('?');            // char 40
                    block.ShtnHanglIsuNm    = query.GetFieldData(block.GetBlockName(), "ShtnHanglIsuNm", i).TrimEnd('?');               // char 40
                    block.CsgnMgnrt         = query.GetFieldData(block.GetBlockName(), "CsgnMgnrt", i).ParseDouble("CsgnMgnrt");        // double 26.9
                    block.MaintMgnrt        = query.GetFieldData(block.GetBlockName(), "MaintMgnrt", i).ParseDouble("MaintMgnrt");      // double 26.9
                    block.MnyMgnrt          = query.GetFieldData(block.GetBlockName(), "MnyMgnrt", i).ParseDouble("MnyMgnrt");          // double 26.9
                    block.RmndDays          = query.GetFieldData(block.GetBlockName(), "RmndDays", i).ParseLong("RmndDays");            // long 6
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
예제 #2
0
        public static XQMMDAQ91200OutBlock1 FromQuery(XQMMDAQ91200 query)
        {
            XQMMDAQ91200OutBlock1 block = new XQMMDAQ91200OutBlock1();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.RecCnt        = query.GetFieldData(block.GetBlockName(), "RecCnt", 0).ParseLong("RecCnt");          // long 5
                block.IsuLgclssCode = query.GetFieldData(block.GetBlockName(), "IsuLgclssCode", 0).TrimEnd('?');          // char 2
                block.IsuMdclssCode = query.GetFieldData(block.GetBlockName(), "IsuMdclssCode", 0).TrimEnd('?');          // char 2
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }