예제 #1
0
        public static XQCFOBQ10800OutBlock1 FromQuery(XQCFOBQ10800 query)
        {
            XQCFOBQ10800OutBlock1 block = new XQCFOBQ10800OutBlock1();

            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.PrdgrpClssCode = query.GetFieldData(block.GetBlockName(), "PrdgrpClssCode", 0).TrimEnd('?');     // char 2
                block.ClssGrpCode    = query.GetFieldData(block.GetBlockName(), "ClssGrpCode", 0).TrimEnd('?');        // char 3
                block.BaseYear       = query.GetFieldData(block.GetBlockName(), "BaseYear", 0).TrimEnd('?');           // char 4
                block.FstmmTpCode    = query.GetFieldData(block.GetBlockName(), "FstmmTpCode", 0).FirstOrDefault();    // char 1
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
예제 #2
0
        public static XQAllOutBlocks Get(long RecCnt = default, string PrdgrpClssCode = default, string ClssGrpCode = default, string BaseYear = default, char FstmmTpCode = default)
        {
            using (XQCFOBQ10800 instance = new XQCFOBQ10800())
            {
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.RecCnt, 0, RecCnt.ToString("d5"));       // long 5
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.PrdgrpClssCode, 0, PrdgrpClssCode);      // char 2
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.ClssGrpCode, 0, ClssGrpCode);            // char 3
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.BaseYear, 0, BaseYear);                  // char 4
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.FstmmTpCode, 0, FstmmTpCode.ToString()); // char 1

                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);
            }
        }
예제 #3
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, long RecCnt = default,string PrdgrpClssCode = default,string ClssGrpCode = default,string BaseYear = default,char FstmmTpCode = default */)
        {
            using (XQCFOBQ10800 instance = new XQCFOBQ10800())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQCFOBQ10800OutBlock2" : $"XQCFOBQ10800OutBlock2_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock2 = instance.SelectMany <XQCFOBQ10800OutBlock2>(qo);
                return(results);
            }
        }
예제 #4
0
        public static XQCFOBQ10800OutBlock2[] Get(long RecCnt = default, string PrdgrpClssCode = default, string ClssGrpCode = default, string BaseYear = default, char FstmmTpCode = default)
        {
            using (XQCFOBQ10800 instance = new XQCFOBQ10800())
            {
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.RecCnt, 0, RecCnt.ToString("d5"));       // long 5
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.PrdgrpClssCode, 0, PrdgrpClssCode);      // char 2
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.ClssGrpCode, 0, ClssGrpCode);            // char 3
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.BaseYear, 0, BaseYear);                  // char 4
                instance.SetFieldData(XQCFOBQ10800InBlock1.BlockName, XQCFOBQ10800InBlock1.F.FstmmTpCode, 0, FstmmTpCode.ToString()); // char 1

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

                var outBlock = instance.GetBlock2s();
                return(outBlock);
            }
        }
예제 #5
0
        public static XQCFOBQ10800OutBlock2[] ListFromQuery(XQCFOBQ10800 query)
        {
            int count = query.GetBlockCount(XQCFOBQ10800OutBlock2.BlockName);
            List <XQCFOBQ10800OutBlock2> list = new List <XQCFOBQ10800OutBlock2>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQCFOBQ10800OutBlock2 block = new XQCFOBQ10800OutBlock2();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.ElwXrcPrc          = query.GetFieldData(block.GetBlockName(), "ElwXrcPrc", i).ParseDouble("ElwXrcPrc");                   // double 13.2
                    block.FnoIsuNo           = query.GetFieldData(block.GetBlockName(), "FnoIsuNo", i).TrimEnd('?');                                // char 12
                    block.HanglIsuNm1        = query.GetFieldData(block.GetBlockName(), "HanglIsuNm1", i).TrimEnd('?');                             // char 40
                    block.TpNm1              = query.GetFieldData(block.GetBlockName(), "TpNm1", i).TrimEnd('?');                                   // char 40
                    block.UpOptRegulThrprc   = query.GetFieldData(block.GetBlockName(), "UpOptRegulThrprc", i).ParseDouble("UpOptRegulThrprc");     // double 27.8
                    block.Thrprc1            = query.GetFieldData(block.GetBlockName(), "Thrprc1", i).ParseDouble("Thrprc1");                       // double 19.8
                    block.BasePrc1           = query.GetFieldData(block.GetBlockName(), "BasePrc1", i).ParseDouble("BasePrc1");                     // double 13.2
                    block.OrdMgn1            = query.GetFieldData(block.GetBlockName(), "OrdMgn1", i).ParseLong("OrdMgn1");                         // long 16
                    block.FnoIsuNo0          = query.GetFieldData(block.GetBlockName(), "FnoIsuNo0", i).TrimEnd('?');                               // char 12
                    block.HanglIsuNm2        = query.GetFieldData(block.GetBlockName(), "HanglIsuNm2", i).TrimEnd('?');                             // char 40
                    block.TpNm2              = query.GetFieldData(block.GetBlockName(), "TpNm2", i).TrimEnd('?');                                   // char 40
                    block.DownOptRegulThrprc = query.GetFieldData(block.GetBlockName(), "DownOptRegulThrprc", i).ParseDouble("DownOptRegulThrprc"); // double 27.8
                    block.Thrprc2            = query.GetFieldData(block.GetBlockName(), "Thrprc2", i).ParseDouble("Thrprc2");                       // double 19.8
                    block.BasePrc2           = query.GetFieldData(block.GetBlockName(), "BasePrc2", i).ParseDouble("BasePrc2");                     // double 13.2
                    block.OrdMgn2            = query.GetFieldData(block.GetBlockName(), "OrdMgn2", i).ParseLong("OrdMgn2");                         // long 16
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }