Exemplo n.º 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());
        }
Exemplo n.º 2
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, long RecCnt = default,string IsuLgclssCode = default,string IsuMdclssCode = default */)
        {
            using (XQMMDAQ91200 instance = new XQMMDAQ91200())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

                string      tableName = (tableNamePostfix == null) ? "XQMMDAQ91200OutBlock1" : $"XQMMDAQ91200OutBlock1_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                results.OutBlock1 = instance.Select <XQMMDAQ91200OutBlock1>(qo);

                tableName         = (tableNamePostfix == null) ? "XQMMDAQ91200OutBlock2" : $"XQMMDAQ91200OutBlock2_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock2 = instance.SelectMany <XQMMDAQ91200OutBlock2>(qo);
                return(results);
            }
        }
Exemplo n.º 3
0
        public static XQMMDAQ91200OutBlock2[] Get(long RecCnt = default, string IsuLgclssCode = default, string IsuMdclssCode = default)
        {
            using (XQMMDAQ91200 instance = new XQMMDAQ91200())
            {
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.RecCnt, 0, RecCnt.ToString("d5"));                // long 5
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.IsuLgclssCode, 0, IsuLgclssCode);                 // char 2
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.IsuMdclssCode, 0, IsuMdclssCode);                 // char 2

                if (instance.Request() < 0)
                {
                    return(null);
                }

                var outBlock = instance.GetBlock2s();
                return(outBlock);
            }
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public static XQAllOutBlocks Get(long RecCnt = default, string IsuLgclssCode = default, string IsuMdclssCode = default)
        {
            using (XQMMDAQ91200 instance = new XQMMDAQ91200())
            {
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.RecCnt, 0, RecCnt.ToString("d5"));                // long 5
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.IsuLgclssCode, 0, IsuLgclssCode);                 // char 2
                instance.SetFieldData(XQMMDAQ91200InBlock1.BlockName, XQMMDAQ91200InBlock1.F.IsuMdclssCode, 0, IsuMdclssCode);                 // char 2

                if (instance.Request() < 0)
                {
                    return(null);
                }

                XQAllOutBlocks results = new XQAllOutBlocks();
                results.OutBlock1 = instance.GetBlock1();
                if (results.OutBlock1.IsValidData == false)
                {
                    return(null);
                }

                results.OutBlock2 = instance.GetBlock2s();
                return(results);
            }
        }