예제 #1
0
파일: t3341.cs 프로젝트: tdoobw/XingAPI
        public static XQAllOutBlocks Get(char gubun = default, char gubun1 = default, char gubun2 = default, long idx = default)
        {
            using (XQt3341 instance = new XQt3341())
            {
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun, 0, gubun.ToString());                 // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun1, 0, gubun1.ToString());               // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun2, 0, gubun2.ToString());               // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.idx, 0, idx.ToString("d4"));                 // long 4

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

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

                results.OutBlock1 = instance.GetBlock1s();
                return(results);
            }
        }
예제 #2
0
파일: t3341.cs 프로젝트: tdoobw/XingAPI
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char gubun = default,char gubun1 = default,char gubun2 = default,long idx = default */)
        {
            using (XQt3341 instance = new XQt3341())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

                string      tableName = (tableNamePostfix == null) ? "XQt3341OutBlock" : $"XQt3341OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                results.OutBlock = instance.Select <XQt3341OutBlock>(qo);

                tableName         = (tableNamePostfix == null) ? "XQt3341OutBlock1" : $"XQt3341OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt3341OutBlock1>(qo);
                return(results);
            }
        }
예제 #3
0
파일: t3341.cs 프로젝트: iPeterPan/XingAPI
        public static XQt3341OutBlock1[] Get(char gubun = default, char gubun1 = default, char gubun2 = default, long idx = default)
        {
            using (XQt3341 instance = new XQt3341())
            {
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun, 0, gubun.ToString());                 // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun1, 0, gubun1.ToString());               // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.gubun2, 0, gubun2.ToString());               // char 1
                instance.SetFieldData(XQt3341InBlock.BlockName, XQt3341InBlock.F.idx, 0, idx.ToString("d4"));                 // long 4

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
예제 #4
0
파일: t3341.cs 프로젝트: iPeterPan/XingAPI
        public static XQt3341OutBlock FromQuery(XQt3341 query)
        {
            XQt3341OutBlock block = new XQt3341OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.cnt = query.GetFieldData(block.GetBlockName(), "cnt", 0).ParseLong("cnt");                 // long 4
                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);
        }
예제 #5
0
파일: t3341.cs 프로젝트: iPeterPan/XingAPI
        public static XQt3341OutBlock1[] ListFromQuery(XQt3341 query)
        {
            int count = query.GetBlockCount(XQt3341OutBlock1.BlockName);
            List <XQt3341OutBlock1> list = new List <XQt3341OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt3341OutBlock1 block = new XQt3341OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.rank                 = query.GetFieldData(block.GetBlockName(), "rank", i).ParseLong("rank");                                 // long 4
                    block.hname                = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                                     // char 20
                    block.salesgrowth          = query.GetFieldData(block.GetBlockName(), "salesgrowth", i).ParseLong("salesgrowth");                   // long 12
                    block.operatingincomegrowt = query.GetFieldData(block.GetBlockName(), "operatingincomegrowt", i).ParseLong("operatingincomegrowt"); // long 12
                    block.ordinaryincomegrowth = query.GetFieldData(block.GetBlockName(), "ordinaryincomegrowth", i).ParseLong("ordinaryincomegrowth"); // long 12
                    block.liabilitytoequity    = query.GetFieldData(block.GetBlockName(), "liabilitytoequity", i).ParseLong("liabilitytoequity");       // long 12
                    block.enterpriseratio      = query.GetFieldData(block.GetBlockName(), "enterpriseratio", i).ParseLong("enterpriseratio");           // long 12
                    block.eps    = query.GetFieldData(block.GetBlockName(), "eps", i).ParseLong("eps");                                                 // long 12
                    block.bps    = query.GetFieldData(block.GetBlockName(), "bps", i).ParseLong("bps");                                                 // long 12
                    block.roe    = query.GetFieldData(block.GetBlockName(), "roe", i).ParseLong("roe");                                                 // long 12
                    block.shcode = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                                                  // char 6
                    block.per    = query.GetFieldData(block.GetBlockName(), "per", i).ParseFloat("per");                                                // float 13.2
                    block.pbr    = query.GetFieldData(block.GetBlockName(), "pbr", i).ParseFloat("pbr");                                                // float 13.2
                    block.peg    = query.GetFieldData(block.GetBlockName(), "peg", i).ParseFloat("peg");                                                // float 13.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }