Ejemplo n.º 1
0
        public static XQCEXAQ31100OutBlock2 FromQuery(XQCEXAQ31100 query)
        {
            XQCEXAQ31100OutBlock2 block = new XQCEXAQ31100OutBlock2();

            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.AcntNo     = query.GetFieldData(block.GetBlockName(), "AcntNo", 0).TrimEnd('?');                // char 20
                block.AcntNm     = query.GetFieldData(block.GetBlockName(), "AcntNm", 0).TrimEnd('?');                // char 40
                block.BnsplAmt   = query.GetFieldData(block.GetBlockName(), "BnsplAmt", 0).ParseLong("BnsplAmt");     // long 16
                block.AdjstDfamt = query.GetFieldData(block.GetBlockName(), "AdjstDfamt", 0).ParseLong("AdjstDfamt"); // long 16
                block.TotEvalAmt = query.GetFieldData(block.GetBlockName(), "TotEvalAmt", 0).ParseLong("TotEvalAmt"); // long 16
                block.TotPnlAmt  = query.GetFieldData(block.GetBlockName(), "TotPnlAmt", 0).ParseLong("TotPnlAmt");   // long 16
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public static XQCEXAQ31100OutBlock1 FromQuery(XQCEXAQ31100 query)
        {
            XQCEXAQ31100OutBlock1 block = new XQCEXAQ31100OutBlock1();

            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.AcntNo        = query.GetFieldData(block.GetBlockName(), "AcntNo", 0).TrimEnd('?');            // char 20
                block.InptPwd       = query.GetFieldData(block.GetBlockName(), "InptPwd", 0).TrimEnd('?');           // char 8
                block.IsuCode       = query.GetFieldData(block.GetBlockName(), "IsuCode", 0).TrimEnd('?');           // char 12
                block.BalEvalTp     = query.GetFieldData(block.GetBlockName(), "BalEvalTp", 0).FirstOrDefault();     // char 1
                block.FutsPrcEvalTp = query.GetFieldData(block.GetBlockName(), "FutsPrcEvalTp", 0).FirstOrDefault(); // char 1
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 3
0
        public static XQCEXAQ31100OutBlock3[] ListFromQuery(XQCEXAQ31100 query)
        {
            int count = query.GetBlockCount(XQCEXAQ31100OutBlock3.BlockName);
            List <XQCEXAQ31100OutBlock3> list = new List <XQCEXAQ31100OutBlock3>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQCEXAQ31100OutBlock3 block = new XQCEXAQ31100OutBlock3();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.FnoIsuNo    = query.GetFieldData(block.GetBlockName(), "FnoIsuNo", i).TrimEnd('?');                // char 12
                    block.IsuNm       = query.GetFieldData(block.GetBlockName(), "IsuNm", i).TrimEnd('?');                   // char 40
                    block.BnsTpCode   = query.GetFieldData(block.GetBlockName(), "BnsTpCode", i).FirstOrDefault();           // char 1
                    block.BnsTpNm     = query.GetFieldData(block.GetBlockName(), "BnsTpNm", i).TrimEnd('?');                 // char 10
                    block.UnsttQty    = query.GetFieldData(block.GetBlockName(), "UnsttQty", i).ParseLong("UnsttQty");       // long 16
                    block.LqdtAbleQty = query.GetFieldData(block.GetBlockName(), "LqdtAbleQty", i).ParseLong("LqdtAbleQty"); // long 16
                    block.FnoAvrPrc   = query.GetFieldData(block.GetBlockName(), "FnoAvrPrc", i).ParseDouble("FnoAvrPrc");   // double 19.8
                    block.BasePrc     = query.GetFieldData(block.GetBlockName(), "BasePrc", i).ParseDouble("BasePrc");       // double 30.10
                    block.NowPrc      = query.GetFieldData(block.GetBlockName(), "NowPrc", i).ParseDouble("NowPrc");         // double 13.2
                    block.CmpPrc      = query.GetFieldData(block.GetBlockName(), "CmpPrc", i).ParseDouble("CmpPrc");         // double 13.2
                    block.EvalAmt     = query.GetFieldData(block.GetBlockName(), "EvalAmt", i).ParseLong("EvalAmt");         // long 16
                    block.EvalPnl     = query.GetFieldData(block.GetBlockName(), "EvalPnl", i).ParseLong("EvalPnl");         // long 16
                    block.PnlRat      = query.GetFieldData(block.GetBlockName(), "PnlRat", i).ParseDouble("PnlRat");         // double 12.6
                    block.UnsttAmt    = query.GetFieldData(block.GetBlockName(), "UnsttAmt", i).ParseLong("UnsttAmt");       // long 16
                    block.BnsplAmt    = query.GetFieldData(block.GetBlockName(), "BnsplAmt", i).ParseLong("BnsplAmt");       // long 16
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }