Ejemplo n.º 1
0
        public static XQt1959OutBlock1[] ListFromQuery(XQt1959 query)
        {
            int count = query.GetBlockCount(XQt1959OutBlock1.BlockName);
            List <XQt1959OutBlock1> list = new List <XQt1959OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1959OutBlock1 block = new XQt1959OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.shcode      = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');               // char 6
                    block.hname       = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                // char 40
                    block.price       = query.GetFieldData(block.GetBlockName(), "price", i).TrimEnd('?');                // char 12
                    block.sign        = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();             // char 1
                    block.change      = query.GetFieldData(block.GetBlockName(), "change", i).TrimEnd('?');               // char 12
                    block.rate        = query.GetFieldData(block.GetBlockName(), "rate", i).ParseFloat("rate");           // float 5.2
                    block.volume      = query.GetFieldData(block.GetBlockName(), "volume", i).TrimEnd('?');               // char 12
                    block.value       = query.GetFieldData(block.GetBlockName(), "value", i).TrimEnd('?');                // char 12
                    block.lp_gb       = query.GetFieldData(block.GetBlockName(), "lp_gb", i).TrimEnd('?');                // char 4
                    block.lp_mem_nm1  = query.GetFieldData(block.GetBlockName(), "lp_mem_nm1", i).TrimEnd('?');           // char 20
                    block.lp_mem_nm2  = query.GetFieldData(block.GetBlockName(), "lp_mem_nm2", i).TrimEnd('?');           // char 20
                    block.lp_mem_nm3  = query.GetFieldData(block.GetBlockName(), "lp_mem_nm3", i).TrimEnd('?');           // char 20
                    block.lp_mem_nm4  = query.GetFieldData(block.GetBlockName(), "lp_mem_nm4", i).TrimEnd('?');           // char 20
                    block.lp_mem_nm5  = query.GetFieldData(block.GetBlockName(), "lp_mem_nm5", i).TrimEnd('?');           // char 20
                    block.lp_min_qty  = query.GetFieldData(block.GetBlockName(), "lp_min_qty", i).TrimEnd('?');           // char 10
                    block.lp_st_date  = query.GetFieldData(block.GetBlockName(), "lp_st_date", i).TrimEnd('?');           // char 8
                    block.lp_end_date = query.GetFieldData(block.GetBlockName(), "lp_end_date", i).TrimEnd('?');          // char 8
                    block.lp_spread   = query.GetFieldData(block.GetBlockName(), "lp_spread", i).ParseFloat("lp_spread"); // float 5.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Ejemplo n.º 2
0
 public XQt1959OutBlock1[] GetBlock1s()
 {
     XQt1959OutBlock1[] instance = XQt1959OutBlock1.ListFromQuery(this);
     return(instance);
 }