Esempio n. 1
0
        public static XQt3320OutBlock FromQuery(XQt3320 query)
        {
            XQt3320OutBlock block = new XQt3320OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.upgubunnm    = query.GetFieldData(block.GetBlockName(), "upgubunnm", 0).TrimEnd('?');                  // char 20
                block.sijangcd     = query.GetFieldData(block.GetBlockName(), "sijangcd", 0).FirstOrDefault();               // char 1
                block.marketnm     = query.GetFieldData(block.GetBlockName(), "marketnm", 0).TrimEnd('?');                   // char 10
                block.company      = query.GetFieldData(block.GetBlockName(), "company", 0).TrimEnd('?');                    // char 100
                block.baddress     = query.GetFieldData(block.GetBlockName(), "baddress", 0).TrimEnd('?');                   // char 100
                block.btelno       = query.GetFieldData(block.GetBlockName(), "btelno", 0).TrimEnd('?');                     // char 20
                block.gsyyyy       = query.GetFieldData(block.GetBlockName(), "gsyyyy", 0).TrimEnd('?');                     // char 4
                block.gsmm         = query.GetFieldData(block.GetBlockName(), "gsmm", 0).TrimEnd('?');                       // char 2
                block.gsym         = query.GetFieldData(block.GetBlockName(), "gsym", 0).TrimEnd('?');                       // char 6
                block.lstprice     = query.GetFieldData(block.GetBlockName(), "lstprice", 0).ParseLong("lstprice");          // long 12
                block.gstock       = query.GetFieldData(block.GetBlockName(), "gstock", 0).ParseLong("gstock");              // long 12
                block.homeurl      = query.GetFieldData(block.GetBlockName(), "homeurl", 0).TrimEnd('?');                    // char 50
                block.grdnm        = query.GetFieldData(block.GetBlockName(), "grdnm", 0).TrimEnd('?');                      // char 30
                block.foreignratio = query.GetFieldData(block.GetBlockName(), "foreignratio", 0).ParseFloat("foreignratio"); // float 6.2
                block.irtel        = query.GetFieldData(block.GetBlockName(), "irtel", 0).TrimEnd('?');                      // char 30
                block.capital      = query.GetFieldData(block.GetBlockName(), "capital", 0).ParseFloat("capital");           // float 12.0
                block.sigavalue    = query.GetFieldData(block.GetBlockName(), "sigavalue", 0).ParseFloat("sigavalue");       // float 12.0
                block.cashsis      = query.GetFieldData(block.GetBlockName(), "cashsis", 0).ParseFloat("cashsis");           // float 12.0
                block.cashrate     = query.GetFieldData(block.GetBlockName(), "cashrate", 0).ParseFloat("cashrate");         // float 13.2
                block.price        = query.GetFieldData(block.GetBlockName(), "price", 0).ParseLong("price");                // long 8
                block.jnilclose    = query.GetFieldData(block.GetBlockName(), "jnilclose", 0).ParseLong("jnilclose");        // long 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Esempio n. 2
0
        public static XQt3320OutBlock1 FromQuery(XQt3320 query)
        {
            XQt3320OutBlock1 block = new XQt3320OutBlock1();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.gicode   = query.GetFieldData(block.GetBlockName(), "gicode", 0).TrimEnd('?');             // char 7
                block.gsym     = query.GetFieldData(block.GetBlockName(), "gsym", 0).TrimEnd('?');               // char 6
                block.gsgb     = query.GetFieldData(block.GetBlockName(), "gsgb", 0).FirstOrDefault();           // char 1
                block.per      = query.GetFieldData(block.GetBlockName(), "per", 0).ParseFloat("per");           // float 13.2
                block.eps      = query.GetFieldData(block.GetBlockName(), "eps", 0).ParseFloat("eps");           // float 13.0
                block.pbr      = query.GetFieldData(block.GetBlockName(), "pbr", 0).ParseFloat("pbr");           // float 13.2
                block.roa      = query.GetFieldData(block.GetBlockName(), "roa", 0).ParseFloat("roa");           // float 13.2
                block.roe      = query.GetFieldData(block.GetBlockName(), "roe", 0).ParseFloat("roe");           // float 13.2
                block.ebitda   = query.GetFieldData(block.GetBlockName(), "ebitda", 0).ParseFloat("ebitda");     // float 13.2
                block.evebitda = query.GetFieldData(block.GetBlockName(), "evebitda", 0).ParseFloat("evebitda"); // float 13.2
                block.par      = query.GetFieldData(block.GetBlockName(), "par", 0).ParseFloat("par");           // float 13.2
                block.sps      = query.GetFieldData(block.GetBlockName(), "sps", 0).ParseFloat("sps");           // float 13.2
                block.cps      = query.GetFieldData(block.GetBlockName(), "cps", 0).ParseFloat("cps");           // float 13.2
                block.bps      = query.GetFieldData(block.GetBlockName(), "bps", 0).ParseFloat("bps");           // float 13.0
                block.t_per    = query.GetFieldData(block.GetBlockName(), "t_per", 0).ParseFloat("t_per");       // float 13.2
                block.t_eps    = query.GetFieldData(block.GetBlockName(), "t_eps", 0).ParseFloat("t_eps");       // float 13.0
                block.peg      = query.GetFieldData(block.GetBlockName(), "peg", 0).ParseFloat("peg");           // float 13.2
                block.t_peg    = query.GetFieldData(block.GetBlockName(), "t_peg", 0).ParseFloat("t_peg");       // float 13.2
                block.t_gsym   = query.GetFieldData(block.GetBlockName(), "t_gsym", 0).TrimEnd('?');             // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }